calibration_eeprom.ino 440 B

1234567891011121314151617181920212223242526272829
  1. #include "MPU9250.h"
  2. #include "eeprom_utils.h"
  3. MPU9250 mpu;
  4. void setup() {
  5. Serial.begin(115200);
  6. Wire.begin();
  7. delay(2000);
  8. mpu.setup(0x68); // change to your own address
  9. delay(5000);
  10. // calibrate when you want to
  11. mpu.calibrateAccelGyro();
  12. mpu.calibrateMag();
  13. // save to eeprom
  14. saveCalibration();
  15. // load from eeprom
  16. loadCalibration();
  17. mpu.printCalibration();
  18. }
  19. void loop() {
  20. }