Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jeki committed Mar 4, 2021
2 parents 7cae778 + 191c0e2 commit 36cb429
Show file tree
Hide file tree
Showing 11 changed files with 1,120 additions and 1,118 deletions.
2 changes: 1 addition & 1 deletion SparkFunMPU9250-DMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ float MPU9250_DMP::computeCompassHeading(void)
heading = (mx < 0) ? PI : 0;
else
heading = atan2(mx, my);

if (heading > PI) heading -= (2 * PI);
else if (heading < -PI) heading += (2 * PI);
else if (heading < 0) heading += 2 * PI;
Expand Down
2 changes: 2 additions & 0 deletions SparkFunMPU9250-DMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ class MPU9250_DMP
// Output: class variable heading will be updated on exit
float computeCompassHeading(void);

float calcCompassHeadingTilt(float acc_x, float acc_y, float acc_z, float mag_x, float mag_y, float mag_z);

// selfTest -- Run gyro and accel self-test.
// Output: Returns bit mask, 1 indicates success. A 0x7 is success on all sensors.
// Bit pos 0: gyro
Expand Down
Loading

0 comments on commit 36cb429

Please sign in to comment.