Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MPU9250_SPI mbed
Fork of MPU9250_AHRS by
Diff: main.cpp
- Revision:
- 28:76e2ba7a1ecd
- Parent:
- 27:7dd32c696d17
- Child:
- 29:6075f35f472f
--- 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,
    