summaryrefslogtreecommitdiff
path: root/CODE/debug/IMU_comp/calcoffset/calcoffset.ino
diff options
context:
space:
mode:
authorabel <abel.tim.t@gmail.com>2024-10-08 17:41:29 +0200
committerabel <abel.tim.t@gmail.com>2024-10-08 17:41:29 +0200
commit5340707b87937d62c6d72197cf494d67851d05e3 (patch)
tree6015df961f22f1850dcefb781ce1475fedab2216 /CODE/debug/IMU_comp/calcoffset/calcoffset.ino
parente0ee73e9de937e15fa1a60b7fe6fa081435119aa (diff)
downloadrobotica-5340707b87937d62c6d72197cf494d67851d05e3.tar.gz
robotica-5340707b87937d62c6d72197cf494d67851d05e3.zip
UPDATE FOLDER STUCTURE
MOET APARTE_PCB NOG VERWIJDERTEN WINDOWS HEEFT BEST VERGRENDELD
Diffstat (limited to 'CODE/debug/IMU_comp/calcoffset/calcoffset.ino')
-rw-r--r--CODE/debug/IMU_comp/calcoffset/calcoffset.ino27
1 files changed, 27 insertions, 0 deletions
diff --git a/CODE/debug/IMU_comp/calcoffset/calcoffset.ino b/CODE/debug/IMU_comp/calcoffset/calcoffset.ino
new file mode 100644
index 0000000..fc5f752
--- /dev/null
+++ b/CODE/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);
+
+}