角度調整用のプログラムです。 (モータードライバー+磁気センサー)

Dependencies:   ATP3012 mbed a HMC US015_2 getGPS

Files at this revision

API Documentation at this revision

Comitter:
ushiroji
Date:
Tue Dec 14 07:13:21 2021 +0000
Parent:
1:f70beec382b6
Commit message:
test

Changed in this revision

Function.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f70beec382b6 -r 83023bafb526 Function.h
--- a/Function.h	Fri Dec 03 08:22:57 2021 +0000
+++ b/Function.h	Tue Dec 14 07:13:21 2021 +0000
@@ -123,9 +123,9 @@
 {
     xbee.printf("calibration start\r\n");
     compass.setCalibrationMode(0x43);
-    Move('4', 0.15);
+    Move('4', 0.17);
     xbee.printf("mortor mode:4 speed:0.1\n\r");
-    wait(180);
+    wait(60);
     Move('1', 0);
     xbee.printf("mortor mode:1 speed:0\n\r");
     compass.setCalibrationMode(0x45);
diff -r f70beec382b6 -r 83023bafb526 main.cpp
--- a/main.cpp	Fri Dec 03 08:22:57 2021 +0000
+++ b/main.cpp	Tue Dec 14 07:13:21 2021 +0000
@@ -5,6 +5,20 @@
 int main() {
     double angle = 0;
     
+
+  
+    Move('2', 0.5);
+    wait(20);
+    Move('2', 0.3);
+    wait(10);
+    Move('2', 0.18);
+    wait(10);
+    Move('1', 0);
+    wait(10);
+    
+    
+    
+    
     Calibration();
 
     compass.setOpMode(HMC6352_CONTINUOUS, 1, 20);
@@ -26,6 +40,7 @@
                 compass.setOpMode(HMC6352_CONTINUOUS, 1, 20);
                 angle = compass.sample() / 10;
                 xbee.printf("%f\r\n", angle);
+                speak();
             }
         }
 }
\ No newline at end of file