Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion IMU.ino
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ void getEstimatedAttitude(){
// Attitude of the cross product vector GxM
heading = _atan2( EstG.V.X * EstM.V.Z - EstG.V.Z * EstM.V.X , EstG.V.Z * EstM.V.Y - EstG.V.Y * EstM.V.Z );
heading += MAG_DECLINIATION * 10; //add declination
heading = heading /10;
heading = heading / 10;

#if defined(HK_MultiWii_328P)
heading -= 90;
#endif

if ( heading > 180) heading = heading - 360;
else if (heading < -180) heading = heading + 360;
#endif
Expand Down
1 change: 1 addition & 0 deletions def.h
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@
#define GYRO_ORIENTATION(X, Y, Z){gyroADC[ROLL] = Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
#define MAG_ORIENTATION(X, Y, Z) {magADC[ROLL] = X; magADC[PITCH] = Y; magADC[YAW] = -Z;}
#undef INTERNAL_I2C_PULLUPS
#define V_BATPIN A7
#endif

#if defined(CRIUS_AIO_PRO_V1)
Expand Down