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/calcoffset/calcoffset.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/calcoffset/calcoffset.ino')
| -rw-r--r-- | debug/IMU_comp/calcoffset/calcoffset.ino | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/debug/IMU_comp/calcoffset/calcoffset.ino b/debug/IMU_comp/calcoffset/calcoffset.ino new file mode 100644 index 0000000..fc5f752 --- /dev/null +++ b/debug/IMU_comp/calcoffset/calcoffset.ino @@ -0,0 +1,27 @@ +void setup() { + randomSeed(analogRead(0)); + Serial.begin(9600); + +} + +void loop() { + int front = random(0, 360); + int heading = random(0, 360); + Serial.print("Front: "); + Serial.println(front); + Serial.print("heading: "); + Serial.println(heading); + + int offset = heading - front; + if(offset<0){ + offset=(offset+360); + } + Serial.print("offset: "); + Serial.println(offset); + + Serial.println(); + Serial.println(); + + delay(5000); + +} |
