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: autoMode.h
- Revision:
- 69:bf094811b4a9
- Parent:
- 68:2b2b88ecdcce
- Child:
- 78:abb760e0a935
--- a/autoMode.h Thu Oct 08 09:04:48 2015 +0000 +++ b/autoMode.h Sat Oct 10 06:01:19 2015 +0000 @@ -7,11 +7,13 @@ PID velocity_controller(9.0,5274.0 ,0.0,RATE); PID direction_controller(36.0,3.0,0.0,RATE); +#define MAX_VALUE 93 + #ifdef IM920 /***IM920 correspondence***/ void autoIM920() { if(b==7){ /*mode change*/ - if(edge7){ + if(edge7) edge7=0; autoflag=0; Indicator4=0; @@ -57,7 +59,7 @@ else if(b==2){ /*L up*/ if(edge2){ edge2=0; - if(stateL!=28) stateL++; + if(stateL!=MAX_VALUE) stateL++; sendData(4,stateL); } } @@ -71,7 +73,7 @@ else if(b==4){ /*R up*/ if(edge4){ edge4=0; - if(stateR!=28) stateR++; + if(stateR!=MAX_VALUE) stateR++; sendData(5,stateR); } } @@ -133,7 +135,7 @@ else if(l2){ /*L down*/ if(edge_l2){ edge_l2=0; - if(stateL!=28) stateL++; + if(stateL!=MAX_VALUE) stateL++; sendData(4,stateL); } } @@ -147,7 +149,7 @@ else if(r2){ /*R down*/ if(edge_r2){ edge_r2=0; - if(stateR!=28) stateR++; + if(stateR!=MAX_VALUE) stateR++; sendData(5,stateR); } }