2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
88:cbed08732872
Parent:
87:6b6b6611d33f
Child:
89:048a72382b0a
--- a/main_ps3.cpp	Wed Oct 14 09:05:46 2015 +0000
+++ b/main_ps3.cpp	Wed Oct 14 10:05:55 2015 +0000
@@ -80,6 +80,10 @@
 #ifdef BLUE
             //Blue            
             /********************************Nomal Mode*********************************/
+            if(spcount<speed){
+                spcount+=speed/30.0;
+                targ_velocity=spcount;
+            }
             if((step==0)&&((8650.0>x)&&(x>850.0))) {
                 targ_sita=0.06;
                 step=1;
@@ -88,7 +92,7 @@
                 targ_velocity=0.0;
                 step=2;
             }
-            if((step==2)&&(abs(velocity)<1000.0)) {
+            if((step==2)&&((velocity<500.0)&&(velocity>-500.0))){
                 step=3;
                 targ_velocity=speed;
                 flagf=0;
@@ -134,7 +138,7 @@
                 targ_velocity=0.0;
                 step=7;
             }
-            if((step==7)&&(abs(velocity)<1000.0)) {
+            if((step==7)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 targ_velocity=speed;
                 targ_sita=0.065;
@@ -168,7 +172,7 @@
                 targ_velocity=0.0;
                 step=17;
             }
-            if((step==17)&&(abs(velocity)<1000.0)){
+            if((step==17)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 targ_velocity=speed;
                 targ_sita=0.03;
@@ -180,11 +184,11 @@
                 autoflag=0;
             }
             
-            if((x>1550.0)&&(CStep==15)){
+            if((x>1350.0)&&(CStep==15)){
                 sendData(1,5);
                 CStep=16;
             }
-            if((x>2700.0)&&(CStep==16)){
+            if((x>2750.0)&&(CStep==16)){
                 sendData(1,4);
                 CStep=114;
             }