2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
84:919a335ac81e
Parent:
83:e1638c58e1f1
Child:
85:dd18a2d79956
--- a/manualMode.h	Mon Oct 12 06:15:45 2015 +0000
+++ b/manualMode.h	Mon Oct 12 07:42:49 2015 +0000
@@ -135,7 +135,14 @@
         }
     }
     else if(triangle){
-        targSwingRadVelocity = swingspeed;
+        if(edge_triangle){
+            edge_triangle=0;
+            if(targSwingRadVelocity == 0.0) targSwingRadVelocity = swingspeed;
+            else {
+                targSwingRadVelocity = 0.0;
+                contSwing.reset();
+            }
+        }
         /*for(float i=0.0;i<1.0;i+=0.01){
             Motor_swing=i;
             wait(0.02);
@@ -148,11 +155,6 @@
             enableShoot=1;
         }
     }
-    else if(cross){
-        targSwingRadVelocity = 0.0;
-        contSwing.reset();
-//        Motor_swing=0.0;
-    }
     else if(left){
         sendData(1,5);
     }
@@ -169,7 +171,7 @@
     else if(l2){  /*L down*/
         if(edge_l2){
             edge_l2=0;
-            if(stateL!=92) stateL++;
+            if(stateL!=MAX_VALUE) stateL++;
             sendData(4,stateL);
         }
     }
@@ -183,7 +185,7 @@
     else if(r2){  /*R down*/
         if(edge_r2){
             edge_r2=0;
-            if(stateR!=92) stateR++;
+            if(stateR!=MAX_VALUE) stateR++;
             sendData(5,stateR);
         }
     }