2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
101:b67d33e56b66
Parent:
97:5e6f513b26f2
Child:
102:e483c7453f52
Child:
103:ffd3ca4a7a71
diff -r 5769dc0e7478 -r b67d33e56b66 autoMode.h
--- a/autoMode.h	Fri Oct 16 10:58:18 2015 +0000
+++ b/autoMode.h	Sat Oct 17 06:04:49 2015 +0000
@@ -10,10 +10,11 @@
 Timeout OpStart;
 
 void OpponentsStart(){
-    spcount=0.0;
-    step   = 15;
-    CStep  = 15;
-    flaga  = 1;
+    spcount = 0.0;
+    step    = 15;
+    CStep   = 15;
+    flaga   = 1;
+    flagf   = 1;
 }
 
 #ifdef IM920
@@ -26,6 +27,8 @@
             Indicator4=0;
             IndicatorAuto=1;
             flaga=0;
+            Move_l(0.0);
+            Move_r(0.0);
         }
     }
     else if((b==6)&&(!flaga)){ /*start*/
@@ -36,9 +39,9 @@
             spcount=0.0;
 //            targ_velocity=speed;
 //            sendData(7,70);
-            sendData(5,69); //right
+            sendData(5,68); //right
             wait(0.05);
-            sendData(4,70); //left
+            sendData(4,68); //left
             wait(0.05);
             stateR = 69;
             stateL = 69;
@@ -62,7 +65,7 @@
             stateR = 59;
             stateL = 59;
             step   = 5;
-            CStep  = 6;
+            CStep  = 7;
             flaga  = 1;
         }
     }   
@@ -72,19 +75,23 @@
             resetState();
 //            targ_velocity = speed;
 //            sendData(7,70);
-            sendData(5,69); //right
+            sendData(5,72); //right
             wait(0.05);
-            sendData(4,60); //left
+            sendData(4,72); //left
+            /*sendData(5,75); //right
+            wait(0.05);
+            sendData(4,75); //left*/
             wait(0.05);
             stateR = 70;
             stateL = 70;
             step=114;
             CStep=114;
-            OpStart.attach(&OpponentsStart,5.0);
+            OpStart.attach(&OpponentsStart,3.0);
 //            spcount=0.0;
 //            step   = 15;
 //            CStep  = 15;
 //            flaga  = 1;
+//            flagf  = 1;
         }
     }
     else if(b==9){ /******/
@@ -150,9 +157,9 @@
             flagf=1;
             targ_velocity=speed;
 //            sendData(7,70);
-            sendData(5,69);
+            sendData(5,68);
             wait(0.1);
-            sendData(4,69);
+            sendData(4,68);
             stateR = 69;
             stateL = 69;
             step   = 0;