diff options
| author | Abel Tim <abel@main.home> | 2024-07-07 15:47:30 +0200 |
|---|---|---|
| committer | Abel Tim <abel@main.home> | 2024-07-07 15:47:30 +0200 |
| commit | 3ce2797f62a124a54644968141feab710b816837 (patch) | |
| tree | f916489adcab192bd471f4e7f0d0dbebc46c7148 /debug/IMU_comp/IMU_comp.ino | |
| parent | 230b3c7db6c2dbb38aa987e52d31e13804300731 (diff) | |
| download | robotica-3ce2797f62a124a54644968141feab710b816837.tar.gz robotica-3ce2797f62a124a54644968141feab710b816837.zip | |
setting 1 complete need to do 2, 3, 4
Diffstat (limited to 'debug/IMU_comp/IMU_comp.ino')
| -rw-r--r-- | debug/IMU_comp/IMU_comp.ino | 3 |
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); |
