Masahiro Furukawa / Mbed 2 deprecated MPU-9250-Ch2_AHRS_test

Dependencies:   MPU9250_SPI mbed

Fork of MPU9250_AHRS by maedalab

Revision:
28:76e2ba7a1ecd
Parent:
27:7dd32c696d17
Child:
29:6075f35f472f
diff -r 7dd32c696d17 -r 76e2ba7a1ecd main.cpp
--- a/main.cpp	Wed Jul 06 09:30:37 2016 +0000
+++ b/main.cpp	Wed Jul 06 10:02:49 2016 +0000
@@ -11,7 +11,7 @@
 #include "MPU9250.h"
 #include "MadgwickAHRS.h"
 #include "MahonyAHRS.h"
-//#define DEBUG_putc  //Wada
+#define DEBUG_putc  //Wada
 
 /* MPU9250 Library
  *
@@ -34,7 +34,7 @@
 mpu9250_spi     *imu[2];
 
 // define AHRS filters
-MadgwickAHRS    *ahrs[2];
+MahonyAHRS    *ahrs[2];
 
 // define serial objects
 Serial          pc(USBTX, USBRX);
@@ -55,8 +55,8 @@
     imu[0] = new mpu9250_spi(spi, p8);
     imu[1] = new mpu9250_spi(spi, p9);
 
-    ahrs[0] = new MadgwickAHRS();
-    ahrs[1] = new MadgwickAHRS();
+    ahrs[0] = new MahonyAHRS();
+    ahrs[1] = new MahonyAHRS();
 
     for(int i=0; i<2; i++) {
 
@@ -108,7 +108,7 @@
     
     // update filters
     for(int i=0; i<2; i++) 
-       ahrs[i]->update(
+       ahrs[i]->MahonyAHRSupdate(
         imu[i]->gyroscope_data[0]*DEGREE2RAD,
         imu[i]->gyroscope_data[1]*DEGREE2RAD,
         imu[i]->gyroscope_data[2]*DEGREE2RAD,