2015/06/09

Dependencies:   ADXL345 AigamozuControlPackets HMC5843 ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST mbed

Fork of Aigamozu_Robot_ver4_4 by aigamozu

Revision:
30:7f6ebe2121d9
Parent:
29:524684a1198f
Child:
31:3f91f4bfca8a
--- a/main.cpp	Tue May 19 10:27:43 2015 +0000
+++ b/main.cpp	Tue May 19 10:52:39 2015 +0000
@@ -429,7 +429,7 @@
     //interrupt start
     refresh_Timer.start();
     auto_Timer.start();
-    Move_Timer.start();
+    agz.Move_Timer.start();
     collect_Timer.start();
     printf("start\n");
     
@@ -464,6 +464,7 @@
                     }
                     case CHANGE_MODE:{
                         New_Mode(buf);
+                        Move_Timer.reset();
                         break;
                     }
                     case RECEIVE_STATUS:{
@@ -519,19 +520,19 @@
         }
         
      if(agz.nowMode == AUTO_GPS_MODE){
-        if(Move_Timer.read_ms() < straight){
+        if(agz.Move_Timer.read_ms() < straight){
            agz.test_Auto(0); //straight
         }
-        if(Move_Timer.read_ms() > straight && Move_Timer.read_ms() < wait){
+        if(agz.Move_Timer.read_ms() > straight && agz.Move_Timer.read_ms() < wait){
             agz.test_Auto(1);
         }
-        if(Move_Timer.read_ms() > wait && Move_Timer.read_ms() < turning){
+        if(agz.Move_Timer.read_ms() > wait && agz.Move_Timer.read_ms() < turning){
             agz.test_Auto(2); //Turn Right
         }   
-        if(Move_Timer.read_ms() > turning){
+        if(agz.Move_Timer.read_ms() > turning){
             agz.test_Auto(3);
             wait_ms(200);
-            Move_Timer.reset();
+            agz.Move_Timer.reset();
         }
     }
     }