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:
- 33:a4323c20494b
- Parent:
- 32:b8c8ad2eeca7
- Child:
- 34:aa2a5c888a27
--- a/autoMode.h Wed Nov 11 06:40:39 2015 +0000 +++ b/autoMode.h Thu Nov 12 07:23:30 2015 +0000 @@ -8,7 +8,7 @@ /***IM920 correspondence***/ void autoIM920() { - if(b==7){ //mode change + /*if(b==7){ //mode change if(edge7) { edge7=0; autoflag=0; @@ -24,8 +24,22 @@ spcount=speed; dpcount=0.0; } + }*/ + if(!modeflag){ //mode change + autoflag=0; + Indicator4=0; + IndicatorAuto=1; + targ_velocity=0.0; + resetState(1); + flaga=0; + step=114; + CStep=114; + mstep=114; + mCStep=114; + spcount=speed; + dpcount=0.0; } - else if((b==6)&&(!flaga)){ //Own & Middle Start + if((b==6)&&(!flaga)){ //Own & Middle Start if(edge6){ edge6=0; resetState(1); @@ -34,20 +48,13 @@ dpcount=0.0; direction_controller.setBias(0.0); #ifdef BLUE - sendData(5,69); //right + sendData(5,69); //over wait(0.05); - sendData(4,69); //left + sendData(4,68); //front wait(0.05); - sendData(6,8); //middle + sendData(6,7); //middle stateR = 69; stateL = 69; - /*sendData(5,65); //right - wait(0.05); - sendData(4,65); //left - wait(0.05); - sendData(6,10); //middle - stateR = 69; - stateL = 69;*/ #else sendData(5,69); //right wait(0.05); @@ -62,29 +69,22 @@ flaga = 1; } } - else if((b==9)&&(!flaga)){ //Own & Opponent Start - if(edge9){ - edge9=0; + else if((b==5)&&(!flaga)){ //Own & Opponent Start + if(edge5){ + edge5=0; resetState(1); flagf=1; spcount=0.0; dpcount=0.0; direction_controller.setBias(0.0); #ifdef BLUE - sendData(5,67); //right - wait(0.05); - sendData(4,67); //left + sendData(5,60); //right wait(0.05); - sendData(6,60); //middle - stateR = 69; - stateL = 69; - /*sendData(5,65); //right - wait(0.05); - sendData(4,65); //left + sendData(4,60); //left wait(0.05); sendData(6,10); //middle stateR = 69; - stateL = 69;*/ + stateL = 69; #else sendData(5,69); //right wait(0.05);