2015_robocon_bteam / Mbed 2 deprecated 2015robot_main

Dependencies:   PID QEI mbed

Fork of 2015robot_main by Naoto Deguchi

Revision:
70:5b8ed76a31c7
Parent:
66:14df82661dfa
Child:
71:4ebc1c0fcb4e
--- a/main_ps3.cpp	Wed Oct 07 09:01:34 2015 +0000
+++ b/main_ps3.cpp	Fri Oct 09 07:20:12 2015 +0000
@@ -5,6 +5,7 @@
 //速度コントローラと向きコントローラはそのまま
 //大和田にPIC1のシリンダの信号をタイマーで書かせる
 //回転機構wait PI/4 追加で待つ
+//射出をスキップする機能を追加
 
 /***コース選択***/
 #define BLUE
@@ -61,16 +62,22 @@
             //Blue            
 //            if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.0,step=1;
 //            if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.015,step=1; /*nomal*/
-            if((step==0)&&((8650.0>x)&&(x>900.0))) targ_sita=0.015,step=1; /*nomal*/
+            if((step==0)&&((8650.0>x)&&(x>900.0))) targ_sita=0.03,step=1; /*nomal*/
             if((step==1)&&(x>8650.0)) targ_velocity=-speed,step=2,flagf=0;
-            if((step==2)&&(x<1950.0)) {
+            if((step==2)&&(x<1700.0)) {
                 targ_sita=PI/4;
                 step=3;
                 sendData(7,31);
             }
-            if((step==3)&&(x<70.0)) targ_velocity=0.0,step=8;
+            if((step==3)&&(x<-100.0)) targ_velocity=0.0,step=8;
+            /*if((step==2)&&(x<1950.0)) {
+                targ_sita=PI/4;
+                step=3;
+                sendData(7,31);
+            }
+            if((step==3)&&(x<70.0)) targ_velocity=0.0,step=8;*/
             
-            if((step==4)&&((5700.0>x)&&(x>900.0))) targ_sita=0.015,step=5; /*middle*/
+            if((step==4)&&((5700.0>x)&&(x>900.0))) targ_sita=0.03,step=5; /*middle*/
             if((step==5)&&(x>5000.0)) { /*middle shoot*/
                 targ_velocity=-speed;
                 step=6;
@@ -87,7 +94,7 @@
             if((x>2900.0)&&(CStep==1)) CStep=2,sendData(1,1); /*nomal*/
             if((x>5850.0)&&(CStep==2)) CStep=3,sendData(1,2);
             if((x>7600.0)&&(CStep==3)) CStep=4,sendData(1,3);
-            if((x<6500.0)&&(CStep==4)) CStep=5,sendData(1,5);
+            if((x<6600.0)&&(CStep==4)) CStep=5,sendData(1,5);
             if((x<6100.0)&&(CStep==5)) CStep=6,sendData(1,4);
             
             /*if((x>3344.0)&&(CStep==1)) CStep=2,sendData(1,1);