![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
SN & YM
Dependencies: HMC5883L MPU6050 ledControl2 mbed
Fork of IMU_fusion by
Diff: main.cpp
- Revision:
- 3:0760d7a202e2
- Parent:
- 2:3881894aaff5
--- 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 */