-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Description
I ran your i2c example, but I added Serial print statements for Arduino Serial Plotter labels, adding offsets so the traces don't overlap.
if (imu.Read()) {
Serial.print("Max:250,");
Serial.print("NewIMU:");
Serial.print(imu.new_imu_data()*150);
Serial.print(",");
Serial.print("NewMAG:");
Serial.print(imu.new_mag_data()*100);
Serial.print(",");
Serial.print("AccX:");
Serial.print(imu.accel_x_mps2());
Serial.print(",");
Serial.print("AccY:");
Serial.print(imu.accel_y_mps2()-20);
Serial.print(",");
Serial.print("AccZ:");
Serial.print(imu.accel_z_mps2()-40);
Serial.print(",");
Serial.print("GyrX:");
Serial.print(imu.gyro_x_radps()-20);
Serial.print(",");
Serial.print("GyrY:");
Serial.print(imu.gyro_y_radps()-40);
Serial.print(",");
Serial.print("GyrZ:");
Serial.print(imu.gyro_z_radps()-60);
Serial.print(",");
Serial.print("MagX:");
Serial.print(imu.mag_x_ut());
Serial.print(",");
Serial.print("MagY:");
Serial.print(imu.mag_y_ut()-20);
Serial.print(",");
Serial.print("MagZ:");
Serial.print(imu.mag_z_ut());
Serial.println("Min:-250");
//Serial.print(imu.die_temp_c());
//Serial.print("\n");
when I run this example with my ESP32 Dev Board and MPU9250 board, I use Arduino Serial Plotter and get the following plot:
Searching the web - I found this post about gyro glitches:
https://forums.adafruit.com/viewtopic.php?f=19&p=531590
I wonder if the issue is similar - the code is getting interrupted between individual MPU register reads, and should read whole blocks of MPU i2c registers to prevent this kind of issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
