Closed eskhisov closed 5 years ago
Ok, so I've got it to work, sort off. See attached code, which is modified Example1-RotationVector.ino. Caveats:
ESPs are notorious for their odd I2C issues. I can't work on this at the moment but we've found various solutions
I will try those suggestions.
Having the following in the setup got it working for me, don't ask me why. Connection: SDA = 4 => D2. SCL = 5 => D1
Setup:
delay(100); // Allow BNO080 to startup
// Start i2c and BNO080 Wire.begin(5, 4); // idk why but removing this wouldnt work IMU.begin(BNO080_DEFAULT_ADDRESS, Wire); Wire.begin(4, 5); // Wire.setClockStretchLimit(4000);
@DaStewie Wow, it does work. My setup is 2,14 but it works for it too:
delay(100); //would not work without this delay Serial.println("BNO080 Read Example");
Wire.begin(5,4); myIMU.begin(BNO080_DEFAULT_ADDRESS, Wire); Wire.begin(2, 14); // (SCLpin,SDApin) Wire.setClockStretchLimit(4000);
Managed to figure out what Wire.begin(5, 4) did. Using flush resets the index and allows for a proper startup.
delay(100); // Wait for BNO to boot
// Start i2c and BNO080
Wire.flush(); // Reset I2C
IMU.begin(BNO080_DEFAULT_ADDRESS, Wire);
Wire.begin(4, 5);
Wire.setClockStretchLimit(4000);
This works too. And much more rational.
Thanks you two! I've added this code (commented out) and a link to this issue in Example 1. Hopefully it will help future ESP users.
I am trying to connect ESP8266 Thing, or any ESP8266 board for that matter, to BNO080 via I2C interface and it is not working. I have tried different things, including setting different parameters on Wire library, but nothing works. Even when ESP8266 recognizes that there is a sensor attached, which seems to be about 70% of the time, the loop() function does not generate any data. If I turn on debugging, I get a steady stream of 'I2C Timeout' messages.