2015_robocon_bteam / Mbed 2 deprecated 2015robot_main_zenkoku

Dependencies:   PID QEI mbed

Revision:
3:8d8c25c556ae
Parent:
2:738b28f6a04b
Child:
6:ca3a74a93ae2
--- a/autoMode.h	Fri Oct 30 09:21:03 2015 +0000
+++ b/autoMode.h	Sat Oct 31 00:30:52 2015 +0000
@@ -22,6 +22,7 @@
 void autoIM920() {
     if(b==7){  /*mode change*/
         if(edge7) {
+            Com.detach();
             edge7=0;
             autoflag=0;
             Indicator4=0;
@@ -340,13 +341,21 @@
     if(flagf==0){
 //        Vr                  = ( 2.0*(-x1) + x2 ) / 3.0;
 //        Vl                  = ( 2.0*(-x1) - x2 ) / 3.0;
-        if(x2>0.0){
+        /*if(x2>0.0){
             Vr                  = -x1;
             Vl                  = -x1 - x2;
         }
         else{
             Vr                  = -x1 + x2;
             Vl                  = -x1;
+        }*/
+        if(x2>0.0){
+            Vr                  = -x1 + x2;
+            Vl                  = -x1;
+        }
+        else{
+            Vr                  = -x1;
+            Vl                  = -x1 - x2;
         }
     }
     else if(flagf==1){