Hi,
Got a weird bug in my code or with my hardware I’m not exactly sure. Im hoping someone has come across this
fifoCount = mpu.getFIFOCount();
while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
mpu.getFIFOBytes(fifoBuffer, packetSize);
fifoCount -= packetSize;
mpu.dmpGetQuaternion(&q, fifoBuffer);
////Control
char val = Serial.read();
delay(10);
frontDistance = fsonar.ping_cm();
delay(10);
rearDistance = rsonar.ping_cm();
delay(10);
leftDistance = leftsonar.ping_cm();
delay(10);
rightDistance = rightsonar.ping_cm();
The reading of the 4 sensors is 100% screwing with my MPU readings and I have no idea why.
-0.00 -0.04 -0.00 1.00
-0.00 -0.04 -0.00 1.00
-0.21 -1.66 0.87 0.00
-1.56 0.19 -1.29 -0.17
The first two readings are acurate but after that I get these kind of sporadic values on the breakout.
Has anyone any ideas?
Thanks!