diff options
| author | robosoccer <robosoccer@mendelcollege.nl> | 2025-03-20 12:06:06 +0100 |
|---|---|---|
| committer | robosoccer <robosoccer@mendelcollege.nl> | 2025-03-20 12:06:06 +0100 |
| commit | 7e9328765f41a6055a722285678bc6bc09963c07 (patch) | |
| tree | 7e02d638585b455fcea38a8e88d5fc71c3fcd1ba /CODE/debug/prewk/IMU_comp/calcoffset/calcoffset.ino | |
| parent | 2bcc96fb10a4a84a7e5537d1d3258a7f919b6917 (diff) | |
| download | robotica-7e9328765f41a6055a722285678bc6bc09963c07.tar.gz robotica-7e9328765f41a6055a722285678bc6bc09963c07.zip | |
update
Diffstat (limited to 'CODE/debug/prewk/IMU_comp/calcoffset/calcoffset.ino')
| -rw-r--r-- | CODE/debug/prewk/IMU_comp/calcoffset/calcoffset.ino | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/CODE/debug/prewk/IMU_comp/calcoffset/calcoffset.ino b/CODE/debug/prewk/IMU_comp/calcoffset/calcoffset.ino new file mode 100644 index 0000000..fc5f752 --- /dev/null +++ b/CODE/debug/prewk/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); + +} |
