You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the code examples, if I run IMU.calibrateMPU9250(IMU.gyroBias, IMU.accelBias); to calibrate the bias, my program will crash with a divide-by-zero error. Upon further investigation, I found that
returns 0 and thus the lines 258-260 on MPU9250.cpp below will crash: accel_bias[0] /= (int32_t) packet_count; // Normalize sums to get average count biases accel_bias[1] /= (int32_t) packet_count; accel_bias[2] /= (int32_t) packet_count;
The way I fixed this was simply commenting out line 236 of MPU9250.cpp //writeByte(MPU9250_ADDRESS, FIFO_EN, 0x00); // Disable gyro and accelerometer sensors for FIFO
Now, the read operation will return a non-zero value.