2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
96:a972ba5cf2d7
Parent:
90:9fe39ebe721f
Child:
97:5e6f513b26f2
--- a/autoMode.h	Fri Oct 16 06:53:36 2015 +0000
+++ b/autoMode.h	Fri Oct 16 07:12:29 2015 +0000
@@ -7,6 +7,15 @@
 PID velocity_controller(9.0,5274.0,0.0,RATE);
 PID direction_controller(36.0,3.0,0.0,RATE);
 
+Timeout OpStart;
+
+void OpponentsStart(){
+    spcount=0.0;
+    step   = 15;
+    CStep  = 15;
+    flaga  = 1;
+}
+
 #ifdef IM920
 /***IM920 correspondence***/
 void autoIM920() {
@@ -61,8 +70,6 @@
         if(edge8){
             edge8=0;
             resetState();
-            flagf = 1;
-            spcount=0.0;
 //            targ_velocity = speed;
 //            sendData(7,70);
             sendData(5,69); //right
@@ -71,9 +78,11 @@
             wait(0.05);
             stateR = 70;
             stateL = 70;
-            step   = 15;
-            CStep  = 15;
-            flaga  = 1;
+            OpStart.attach(&OpponentsStart,5.0);
+//            spcount=0.0;
+//            step   = 15;
+//            CStep  = 15;
+//            flaga  = 1;
         }
     }
     else if(b==9){ /******/