summaryrefslogtreecommitdiff
path: root/debug/IMU_comp/IMU_comp.ino
diff options
context:
space:
mode:
Diffstat (limited to 'debug/IMU_comp/IMU_comp.ino')
-rw-r--r--debug/IMU_comp/IMU_comp.ino3
1 files changed, 3 insertions, 0 deletions
diff --git a/debug/IMU_comp/IMU_comp.ino b/debug/IMU_comp/IMU_comp.ino
index fc35244..c4578cb 100644
--- a/debug/IMU_comp/IMU_comp.ino
+++ b/debug/IMU_comp/IMU_comp.ino
@@ -65,6 +65,9 @@ void loop()
float heading = computeHeading();
int offset = front - heading;
+ if(offset<0){
+ offset=360+offset;
+ }
Serial.print("heading: ");
Serial.print(heading);