Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MPU9250_SPI mbed
Diff: MadgwickAHRS.h
- Revision:
- 30:a1bbb934b053
- Parent:
- 29:6075f35f472f
- Child:
- 31:f30e4effec54
--- a/MadgwickAHRS.h Wed Jul 06 11:44:22 2016 +0000 +++ b/MadgwickAHRS.h Thu Jul 07 04:35:04 2016 +0000 @@ -2,7 +2,7 @@ // Definitions #define sampleFreq 500.0f // sample frequency in Hz -#define betaDef 0.0f // 2 * proportional gain +#define betaDef 0.02f // 2 * proportional gain #define PI 3.14159265358979f #define DEGREE2RAD PI/180.0f class MadgwickAHRS @@ -53,7 +53,8 @@ updateIMU(gx, gy, gz, ax, ay, az); return; } - + + //printf("test\n"); // Rate of change of quaternion from gyroscope qDot1 = 0.5f * (-q1 * gx - q2 * gy - q3 * gz); qDot2 = 0.5f * (q0 * gx + q2 * gz - q3 * gy);