diff --git a/src/SparkFunMPU9250-DMP.cpp b/src/SparkFunMPU9250-DMP.cpp index db57b8f..58af134 100644 --- a/src/SparkFunMPU9250-DMP.cpp +++ b/src/SparkFunMPU9250-DMP.cpp @@ -615,9 +615,9 @@ float MPU9250_DMP::qToFloat(long number, unsigned char q) unsigned long mask = 0; for (int i=0; i> q) + ((number & mask) / (float) (2<<(q-1))); + return (number >> q) + ((number & mask) / (float) (2L<<(q-1))); } void MPU9250_DMP::computeEulerAngles(bool degrees) @@ -700,4 +700,4 @@ static void tap_cb(unsigned char direction, unsigned char count) static void orient_cb(unsigned char orient) { mpu9250_orientation = orient; -} \ No newline at end of file +}