Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of 2015robot_main by
Diff: main_ps3.cpp
- Revision:
- 103:ffd3ca4a7a71
- Parent:
- 101:b67d33e56b66
- Child:
- 104:3c77a48da95c
--- a/main_ps3.cpp Sat Oct 17 06:04:49 2015 +0000
+++ b/main_ps3.cpp Sun Oct 18 00:17:31 2015 +0000
@@ -13,6 +13,7 @@
//大和田射角
//午後に一定回転制御の実験
//モード切替時に時間を待つ
+//赤チーム側を青チーム側のプログラムに合わせて実装
/***コース選択***/
#define BLUE
@@ -69,7 +70,7 @@
double time=0.0;
#endif
wait(0.3);
- sendData(7,255);
+ sendData(7,0);
while(1) {
if(autoflag){
#ifdef IM920
@@ -107,7 +108,7 @@
step=114;
}
/***Cylinder***/
- if((x>3000.0)&&(CStep==1)) {
+ if((x>3030.0)&&(CStep==1)) {
if(!skip) sendData(1,1);
CStep=2;
}
@@ -115,7 +116,7 @@
if(!skip) sendData(1,3);
CStep=3;
}
- if((x>7650.0)&&(CStep==3)) {
+ if((x>7680.0)&&(CStep==3)) {
if(!skip) sendData(1,2);
CStep=4;
}
@@ -128,7 +129,7 @@
CStep=6;
}
if((x<4000.0)&&(CStep==6)){
- sendData(7,255);
+ sendData(7,0);
CStep=114;
}
/////////////////////////////////////////////////////////////////////////
@@ -165,7 +166,7 @@
CStep=9;
}
if((x<4000.0)&&(CStep==9)){
- sendData(7,255);
+ sendData(7,0);
CStep=114;
}
/////////////////////////////////////////////////////////////////////////
@@ -198,13 +199,14 @@
CStep=16;
}
if((x>2550.0)&&(CStep==16)){
+// if((x>2670.0)&&(CStep==16)){
sendData(1,4);
CStep=17;
}
- /*if((x<1000.0)&&(CStep==17)){
- sendData(7,255);
+ if((x<1000.0)&&(CStep==17)){
+ sendData(7,0);
CStep=114;
- }*/
+ }
/////////////////////////////////////////////////////////////////////////
#else
//Red
@@ -230,7 +232,7 @@
if((step==3)&&(x<2050.0)) {
targ_sita=-PI/4;
step=4;
- sendData(7,255);
+ sendData(7,0);
}
if((step==4)&&(x<0.0)) {
targ_velocity=0.0;
@@ -276,7 +278,7 @@
if((step==8)&&(x<1900.0)) {
targ_sita=-PI/4;
step=9;
- sendData(7,255);
+ sendData(7,0);
}
if((step==9)&&(x<-10.0)) {
targ_velocity=0.0;

