2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
97:5e6f513b26f2
Parent:
96:a972ba5cf2d7
Child:
99:ee7f78d64c14
--- a/main_ps3.cpp	Fri Oct 16 07:12:29 2015 +0000
+++ b/main_ps3.cpp	Fri Oct 16 07:42:06 2015 +0000
@@ -201,7 +201,7 @@
             }
             /********************************Nomal Mode*********************************/
             if((step==0)&&((8650.0>x)&&(x>850.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=1; 
             }
             if((step==1)&&(x>8600.0)) {
@@ -212,7 +212,7 @@
                 step=3;
                 spcount=0.0;
                 flagf=0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
             }
             if((step==3)&&(x<2000.0)) {
                 targ_sita=-PI/4;
@@ -247,7 +247,7 @@
             /////////////////////////////////////////////////////////////////////////
             /******************************Middle Mode******************************/
             if((step==5)&&((5700.0>x)&&(x>800.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=6;
             }
             if((step==6)&&(x>7000.0)){
@@ -257,7 +257,7 @@
             if((step==7)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 spcount=0.0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
                 step=8;
             }
             if((step==8)&&(x<1900.0)) {
@@ -281,7 +281,7 @@
             /////////////////////////////////////////////////////////////////////////
             /*****************************Opponents Mode****************************/
             if((step==15)&&((5700.0>x)&&(x>70.0))) {
-                targ_sita=-0.035;
+                targ_sita=0.0;
                 step=16;
             }
             if((step==16)&&(x>2800.0)){
@@ -291,7 +291,7 @@
             if((step==17)&&((velocity<500.0)&&(velocity>-500.0))){
                 flagf=0;
                 spcount=0.0;
-                targ_sita=-0.045;
+                targ_sita=0.0;
                 step=18;
             }
             if((step==18)&&(x<-100.0)){
@@ -300,8 +300,12 @@
                 step=114;
             }
             
-            if((x>2700.0)&&(CStep==15)){
+            if((x>950.0)&&(CStep==15)){
                 sendData(1,4);
+                CStep=16;
+            }
+            if((x>2350.0)&&(CStep==16)){
+                sendData(1,5);
                 CStep=114;
             }
             /////////////////////////////////////////////////////////////////////////