BNO080 - Example1-RotationVector.ino Problem

I am using the BNO080 breakout along with the “SparkFun_BNO080_Arduino_Library.h” library. I have it hooked up through SPI.

I run the included “Example1-RotationVector” SPI version of the sketch from the library and the quaternion values spit out correctly on the serial monitor as expected.

Next, I add a simple delay(1000); in the loop after the Serial.println(); and the quaternion values that are spit out to the serial monitor are now all zeros.

I’ve gone back and forth testing with and without the simple delay, and it is repeatable.

If I use a delay(100); it appears to work fine

if I use a delay(500); nothing is sent to serial monitor

if I use a delay(1000); it sends zeros to serial monitor every second

If I remove the delay; all works fine.

Ideas on why?

I ended up using code from here: GitHub - jps2000/BNO080: Arduino sketch for BNO080 9DOF with sensor fusion … This code accesses the BNO080 directly without a library. All works fine now!

It may be a problem with the “SparkFun_BNO080_Arduino_Library.h” library which was causing the issue I observed.