I am using the official adafruit bno055 imu for my project. I started using the example code to get euler angles from the bno. The issue is that the imu gives data for a few seconds and then starts giving 0. Below is my code and output. Please help with this.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
// Create the BNO055 object
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28); // default I2C address is 0x28 or 0x29
//HardwareSerial Serial4(PC11,PC10);
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("BNO055 Absolute Orientation Test");
if (!bno.begin()) {
Serial.println("Failed to initialize BNO055! Check connections.");
while (1);
}
delay(1000);
bno.setExtCrystalUse(true); // use external crystal for better accuracy
}
void loop() {
// Get absolute orientation as Euler angles (in degrees)
imu::Vector<3> euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);
Serial.print(euler.y());
Serial.print(",");
Serial.println(euler.z());
delay(10);
}```
0.00,0.00
0.00,0.00
0.00,0.00
0.00,0.00
0.00,0.00
0.00,0.00