For whatever reason the delay function is not working (it is not delaying at all) with my ESP32 development board. Has anyone come across a similar issue before? It's not working with other sketches, in either the loop or set up functions. A sample sketch:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
#include <BleMouse.h>
// mouse object
BleMouse ble("test", "me");
/** I2C pins **/
#define I2C_SDA 33
#define I2C_SCL 32
// I2C object
TwoWire wire_custom = TwoWire(0);
// Sensor object
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28, &wire_custom);
/**************************************************************************/
function definitions
...
/**************************************************************************/
void setup(void)
{
wire_custom.begin(I2C_SDA, I2C_SCL, 400000);
Serial.begin(115200);
ble.begin();
if (!bno.begin())
{
Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
while (1);
}
delay(1000);
bno.setExtCrystalUse(true);
// updating range
bno.setMode(Adafruit_BNO055::OPERATION_MODE_CONFIG);
delay(1000);
write_register (0x28, 0x0A, 0b00111010);
bno.setMode(Adafruit_BNO055::OPERATION_MODE_NDOF);
delay(10000);
byte result = read_register (0x28, 0x0A, 1);
Serial.print(result);
Serial.print("\n");
Serial.print("\n");
}
/**************************************************************************/
void loop(void)
{
sensor_calibration ();
sensor_data (x_placeholder, y_placeholder);
transform_sensor_data (x_placeholder, y_placeholder, x, y);
if (ble.isConnected()) {
ble.move(x, y);
}
}
delay()is at fault?loop()in the above code doesn't use a delay, and has no output either.