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:
- 54:9b209c5f25bc
- Parent:
- 50:8ea4714316ce
--- a/main_ps3.cpp Sat Sep 26 08:43:21 2015 +0000 +++ b/main_ps3.cpp Mon Sep 28 00:32:18 2015 +0000 @@ -24,8 +24,10 @@ initializeSwing(); #ifdef BLUE sita=PI/4.0,targ_sita=PI/4.0; + IndicatorBLUE = 1; #else sita=-PI/4.0,targ_sita=-PI/4.0; + IndicatorRED = 1; #endif Indicator4=1; Enable=1; @@ -47,8 +49,9 @@ if((x>3344.0)&&(CStep==1)) CStep=2,sendData(1,1); if((x>6234.0)&&(CStep==2)) CStep=3,sendData(1,2); if((x>7885.0)&&(CStep==3)) CStep=4,sendData(1,3); - if((x<6300.0)&&(CStep==4)) CStep=5,sendData(1,5); - if((x<5900.0)&&(CStep==5)) CStep=6,sendData(1,4); +// if((x<6700.0)&&(CStep==4)) CStep=5,sendData(1,5); + if((x<6750.0)&&(CStep==4)) CStep=5,sendData(1,5); + if((x<6300.0)&&(CStep==5)) CStep=6,sendData(1,4); #else //Red if((step==0)&&((8650.0>x)&&(x>1400.0))) targ_sita=0.0,step=1; @@ -59,12 +62,13 @@ if((x>3344.0)&&(CStep==1)) CStep=2,sendData(1,1); if((x>6234.0)&&(CStep==2)) CStep=3,sendData(1,3); if((x>7885.0)&&(CStep==3)) CStep=4,sendData(1,2); - if((x<6074.0)&&(CStep==4)) CStep=5,sendData(1,4); - if((x<5574.0)&&(CStep==5)) CStep=6,sendData(1,5); +// if((x<6700.0)&&(CStep==4)) CStep=5,sendData(1,5); + if((x<6750.0)&&(CStep==4)) CStep=5,sendData(1,4); + if((x<6300.0)&&(CStep==5)) CStep=6,sendData(1,5); // pc.printf("sita:%f, x:%f, y:%f ,x1:%f, x2:%f ,velocity:%f\r\n",sita,x,y,x1,x2,velocity); #endif move_following(); -// pc.printf("sita:%f, x:%f, y:%f ,x1:%f, x2:%f ,velocity:%f\r\n",sita,x,y,x1,x2,velocity); + pc.printf("sita:%f, x:%f, y:%f ,x1:%f, x2:%f ,velocity:%f\r\n",sita,x,y,x1,x2,velocity); // pc.printf("r:%ld, l:%ld\r\n",Move_r_sense.getPulses(),Move_l_sense.getPulses()); } else if(!autoflag) { @@ -84,6 +88,6 @@ mesureSwing(); wait(RATE); - pc.printf("%f %f\r\n",cont,swingRadVelocity); +// pc.printf("%f %f\r\n",cont,swingRadVelocity); } } \ No newline at end of file