Added external magnetometer functionality

Dependencies:   HMC58X31 MODI2C MPU6050 MS561101BA

Dependents:   Quadcopter_mk2

Fork of FreeIMU by Yifei Teng

Revision:
6:6b1185b32814
Parent:
3:f9b100a9aa65
Child:
9:a79af1283446
--- a/FreeIMU.h	Sat Nov 09 09:00:22 2013 +0000
+++ b/FreeIMU.h	Mon Dec 23 08:35:22 2013 +0000
@@ -106,8 +106,8 @@
 // HMC5843 address is fixed so don't bother to define it
 
 
-#define twoKpDef  (2.0f * 7.5f) // 2 * proportional gain
-#define twoKiDef  (2.0f * 0.25f) // 2 * integral gain
+#define twoKpDef  (2.0f * 1.0f) // 2 * proportional gain
+#define twoKiDef  (2.0f * 0.6f) // 2 * integral gain
 
 #ifndef cbi
 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
@@ -162,6 +162,7 @@
     float exInt, eyInt, ezInt;  // scaled integral error
     volatile float twoKp;      // 2 * proportional gain (Kp)
     volatile float twoKi;      // 2 * integral gain (Ki)
+    volatile float twoKiz, twoKpz;
     volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame
     volatile float integralFBx,  integralFBy, integralFBz;
     Timer update;