Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed TB6612FNG HMC6352 getGPS
Revision 5:9f9cf3912fda, committed 2021-10-27
- Comitter:
 - ushiroji
 - Date:
 - Wed Oct 27 12:26:48 2021 +0000
 - Parent:
 - 4:135619de1646
 - Commit message:
 - test
 
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file | 
diff -r 135619de1646 -r 9f9cf3912fda main.cpp
--- a/main.cpp	Mon Oct 25 11:21:06 2021 +0000
+++ b/main.cpp	Wed Oct 27 12:26:48 2021 +0000
@@ -12,12 +12,15 @@
     while (true) {
         direction = AngleGet();
         pc.printf("direction=%f", direction);
-        if(direction < 5 || direction > 355) {  //角度判定
-            Move('2', 1);
-        }
-        else {
-            Move('1', 0);
-            Move('4', 0.5);
+        while(1) {
+            if(direction < 5 || direction > 355) {  //角度判定
+                Move('2', 1);
+                break;
+            }
+            else {
+                Move('1', 0);
+                Move('4', 0.5);
+            }
         }
         
         if (FrontGet()) {   //障害物判定