maedalab / Mbed 2 deprecated MPU9250_AHRS

Dependencies:   MPU9250_SPI mbed

Revision:
27:7dd32c696d17
Parent:
26:0ffbe34a4953
Child:
29:6075f35f472f
--- a/MadgwickAHRS.h	Wed Jul 06 07:56:19 2016 +0000
+++ b/MadgwickAHRS.h	Wed Jul 06 09:30:37 2016 +0000
@@ -2,7 +2,7 @@
 // Definitions
 
 #define sampleFreq  500.0f      // sample frequency in Hz
-#define betaDef     3.0f        // 2 * proportional gain
+#define betaDef     0.0f        // 2 * proportional gain
 #define PI          3.14159265358979f
 #define DEGREE2RAD  PI/180.0f
 class MadgwickAHRS
@@ -44,6 +44,10 @@
     float hx, hy;
     float _2q0mx, _2q0my, _2q0mz, _2q1mx, _2bx, _2bz, _4bx, _4bz, _2q0, _2q1, _2q2, _2q3, _2q0q2, _2q2q3, q0q0, q0q1, q0q2, q0q3, q1q1, q1q2, q1q3, q2q2, q2q3, q3q3;
 
+    printf("%f %f %f ",gx,gy,gz);
+    printf("%f %f %f ",ax,ay,az);
+    printf("%f %f %f ",mx,my,mz);
+    printf("\n");
     // Use IMU algorithm if magnetometer measurement invalid (avoids NaN in magnetometer normalisation)
     if((mx == 0.0f) && (my == 0.0f) && (mz == 0.0f)) {
         updateIMU(gx, gy, gz, ax, ay, az);