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.
Diff: autoMode.h
- Revision:
- 13:57d8e360e9aa
- Parent:
- 6:ca3a74a93ae2
- Child:
- 17:726b6f53a457
--- a/autoMode.h Mon Nov 02 09:04:20 2015 +0000 +++ b/autoMode.h Tue Nov 03 00:45:17 2015 +0000 @@ -17,7 +17,6 @@ flagf = 1; } -#ifdef IM920 /***IM920 correspondence***/ void autoIM920() { if(b==7){ /*mode change*/ @@ -166,140 +165,6 @@ if(b!=8) edge8=1; if(b!=9) edge9=1; } -#else -void autoPS3(){ - if(circle){ /*mode change*/ - if(edge_circle){ - edge_circle=0; - autoflag=0; - Indicator4=0; - IndicatorAuto=1; - flaga=0; - Move_l(0.0); - Move_r(0.0); - } - } - else if(triangle){ /*start*/ - if(edge_triangle){ - edge_triangle=0; - resetState(); - flagf=1; - spcount=0.0; -// targ_velocity=speed; -#ifdef BLUE -// sendData(5,69); //right - sendData(5,71); //right - wait(0.05); - sendData(4,69); //left - stateR = 69; - stateL = 69; -#else - sendData(5,69); //right - wait(0.05); - sendData(4,69); //left - stateR = 69; - stateL = 69; -#endif - wait(0.05); - step = 0; - CStep = 1; - flaga = 1; - } - } - else if(square){ /*middle start*/ - if(edge_square){ - edge_square=0; - resetState(); - flagf = 1; - spcount=0.0; -// targ_velocity=speed; -#ifdef BLUE - sendData(5,60); //right - wait(0.05); - sendData(4,60); //left - stateR = 60; - stateL = 61; -#else - sendData(5,59); //right - wait(0.05); - sendData(4,59); //left - stateR = 61; - stateL = 60; -#endif - wait(0.05); - step = 5; - CStep = 7; - flaga = 1; - } - } - else if(cross){ /*opponents start*/ - if(edge_cross){ - edge_cross=0; - resetState(); -// targ_velocity = speed; -#ifdef BLUE - sendData(5,69); //right - wait(0.05); - sendData(4,69); //left - stateR = 71; - stateL = 71; -#else - /*sendData(5,66); //right - wait(0.05); - sendData(4,66); //left*/ - /*sendData(4,71); //left - wait(0.05); - sendData(5,71); //right*/ - sendData(4,73); //left - wait(0.05); - sendData(5,73); //right - - stateR = 71; - stateL = 72; -#endif - wait(0.05); - step=114; - CStep=114; - OpStart.attach(&OpponentsStart,2.2); -// OpStart.attach(&OpponentsStart,2.0); - } - } - else if(l1){ /*L up*/ - if(edge_l1){ - edge_l1=0; - if(stateL!=92) stateL++; - sendData(4,stateL); - } - } - else if(l2){ /*L down*/ - if(edge_l2){ - edge_l2=0; - if(stateL!=1) stateL--; - sendData(4,stateL); - } - } - else if(r1){ /*R up*/ - if(edge_r1){ - edge_r1=0; - if(stateR!=92) stateR++; - sendData(5,stateR); - } - } - else if(r2){ /*R down*/ - if(edge_r2){ - edge_r2=0; - if(stateR!=1) stateR--; - sendData(5,stateR); - } - } - if(up){ - skip = 1; - } - else if(!up){ - skip = 0; - } -} -#endif /***The function is PID controller initialize.***/ inline void initializeControllers() {