Library for the MPU9250 9DOF IMU chip.

Dependents:   Xadow-M0_Xadow-OLED_Accelerometer MARe_VT_ble_PeakSearch_Kalman_Inativ

Files at this revision

API Documentation at this revision

Comitter:
ruevs
Date:
Fri Mar 01 09:47:40 2019 +0000
Parent:
0:2315cd1878a1
Commit message:
Add buffers needed for magnetometer calibration.

Changed in this revision

MPU9250.h Show annotated file Show diff for this revision Revisions of this file
diff -r 2315cd1878a1 -r fc94c7336b7c MPU9250.h
--- a/MPU9250.h	Tue Jun 12 08:22:41 2018 +0000
+++ b/MPU9250.h	Fri Mar 01 09:47:40 2019 +0000
@@ -211,7 +211,11 @@
 int16_t accelCount[3];  // Stores the 16-bit signed accelerometer sensor output
 int16_t gyroCount[3];   // Stores the 16-bit signed gyro sensor output
 int16_t magCount[3];    // Stores the 16-bit signed magnetometer sensor output
+int16_t minMagCount[3] = {INT16_MAX, INT16_MAX, INT16_MAX};
+int16_t maxMagCount[3] = {INT16_MIN, INT16_MIN, INT16_MIN};    // Stores the 16-bit signed magnetometer minimum and maximum sensor output
+
 float magCalibration[3] = {0, 0, 0}, magbias[3] = {0, 0, 0};  // Factory mag calibration and mag bias
+float magScale[3] = {1, 1, 1}; // Magnetometer scalig for x, y and z axis
 float gyroBias[3] = {0, 0, 0}, accelBias[3] = {0, 0, 0}; // Bias corrections for gyro and accelerometer
 float ax, ay, az, gx, gy, gz, mx, my, mz; // variables to hold latest sensor data values 
 int16_t tempCount;   // Stores the real internal chip temperature in degrees Celsius