Added external magnetometer functionality

Dependencies:   HMC58X31 MODI2C MPU6050 MS561101BA

Dependents:   Quadcopter_mk2

Fork of FreeIMU by Yifei Teng

Revision:
8:cd43764b9623
Parent:
6:6b1185b32814
Child:
9:a79af1283446
--- a/FreeIMU.cpp	Mon Dec 23 08:37:52 2013 +0000
+++ b/FreeIMU.cpp	Mon Dec 23 09:41:27 2013 +0000
@@ -31,16 +31,6 @@
 
 #define     M_PI 3.1415926535897932384626433832795
 
-#ifdef DEBUG
-#define DEBUG_PRINT(x) Serial.println(x)
-#else
-#define DEBUG_PRINT(x)
-#endif
-// #include "WireUtils.h"
-//#include "DebugUtils.h"
-
-//#include "vector_math.h"
-
 FreeIMU::FreeIMU()
 {
 
@@ -118,12 +108,7 @@
 
     Thread::wait(10);
 
-    printf("AccGyro init start\r\n");
-
-    printf("DeviceId = %d\r\n",accgyro->getDeviceID());
-
     accgyro->initialize();
-    printf("AccGyro setting\r\n");
     accgyro->setI2CMasterModeEnabled(0);
     accgyro->setI2CBypassEnabled(1);
     accgyro->setFullScaleGyroRange(MPU6050_GYRO_FS_1000);
@@ -133,7 +118,6 @@
 
     accgyro->start_sampling();
 
-    printf("AccGyro init fin\r\n");
     Thread::wait(10);
 
     // init HMC5843
@@ -141,25 +125,13 @@
     magn->setGain(0);
     // Calibrate HMC using self test, not recommended to change the gain after calibration.
     magn->calibrate(0, 8); // Use gain 1=default, valid 0-7, 7 not recommended.
-    // Single mode conversion was used in calibration, now set continuous mode
-    //magn.setMode(0);
-
     Thread::wait(30);
-
     magn->setDOR(6);
-
     Thread::wait(30);
-
-    printf("Magn init fin\r\n");
-
     magn->start_sampling();
-
     Thread::wait(30);
-
     baro->init(FIMU_BARO_ADDR);
 
-    printf("Baro init fin\r\n");
-
     // zero gyro
     zeroGyro();