SN & YM

Dependencies:   HMC5883L MPU6050 ledControl2 mbed

Fork of IMU_fusion by Baser Kandehir

Files at this revision

API Documentation at this revision

Comitter:
danusorn
Date:
Sun Nov 04 15:11:28 2018 +0000
Parent:
2:3881894aaff5
Commit message:
jj

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Aug 06 12:25:49 2015 +0000
+++ b/main.cpp	Sun Nov 04 15:11:28 2018 +0000
@@ -37,7 +37,7 @@
 #include "MPU6050.h"
 #include "ledControl.h"
 
-Serial pc(USBTX,USBRX);    
+Serial pc(D1,D0);    
 MPU6050 mpu6050;           
 HMC5883L hmc5883l;    
 Ticker toggler1;
@@ -84,8 +84,7 @@
     
     Xh = mag_Data[0] * cos(rollAngle*PI/180) - mag_Data[2] * sin(rollAngle*PI/180) ;
     
-    Yh = mag_Data[0] * sin(pitchAngle*PI/180) * sin(rollAngle*PI/180) + 
-    mag_Data[1] * cos(pitchAngle*PI/180) -
+    Yh = mag_Data[0] * sin(pitchAngle*PI/180) * sin(rollAngle*PI/180) + mag_Data[1] * cos(pitchAngle*PI/180) -
     mag_Data[2] * sin(pitchAngle*PI/180) * cos(rollAngle*PI/180) ;
     
     /* Calculate the compensated heading angle */