Crude navigation
Dependencies: GPS L3GD20 LSM303DLHC mbed PID
Diff: modSensData.h
- Revision:
- 3:ffa0e1429a72
- Parent:
- 2:503a5ac6c3b6
- Child:
- 4:a397b44a0fe8
diff -r 503a5ac6c3b6 -r ffa0e1429a72 modSensData.h --- a/modSensData.h Wed Mar 04 17:48:08 2015 +0000 +++ b/modSensData.h Mon Mar 09 20:41:28 2015 +0000 @@ -183,7 +183,7 @@ int updateAngles() { readIMU(); - if((accel[0] <= THRESHOLD) && (accel[1] <= THRESHOLD) && (accel[2] <= THRESHOLD)) + if((sqrt(accel[0] * accel[0]) <= THRESHOLD) && (sqrt(accel[1] * accel[1]) <= THRESHOLD) && (sqrt(accel[2] * accel[2]) <= THRESHOLD)) { //float prevYaw = yaw; getAttitude();