SN & YM
Dependencies: HMC5883L MPU6050 ledControl2 mbed
Fork of IMU_fusion by
Revision 3:0760d7a202e2, committed 2018-11-04
- 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 |
diff -r 3881894aaff5 -r 0760d7a202e2 main.cpp --- 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 */