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:
- 78:abb760e0a935
- Parent:
- 69:bf094811b4a9
- Parent:
- 77:7dd154b5ace3
- Child:
- 79:7f86e18f40ef
--- a/autoMode.h Sat Oct 10 06:01:19 2015 +0000 +++ b/autoMode.h Sat Oct 10 09:53:52 2015 +0000 @@ -21,6 +21,7 @@ } } else if(b==6){ /*start*/ + resetState(); flagf=1; targ_velocity=speed; sendData(7,defoR); @@ -30,6 +31,7 @@ CMode = 0; } else if(b==8){ /*middle start*/ + resetState(); flagf=1; targ_velocity=speed; sendData(7,57); @@ -77,6 +79,12 @@ sendData(5,stateR); } } + if(a2){ + skip = 1; + } + else if(!a2){ + skip = 0; + } if(b!=7) edge7=1; if(b!=1) edge1=1; if(b!=2) edge2=1; @@ -94,6 +102,7 @@ } } else if(up){ /*start*/ + resetState(); flagf=1; targ_velocity=speed; sendData(7,defoR); @@ -103,20 +112,28 @@ CStep = 1; } else if(right){ /*middle start*/ + resetState(); flagf = 1; targ_velocity=speed; sendData(7,57); stateR = 17; stateL = 17; step = 4; - CStep = 6; + medge = 1; + } + else if(down){ /*opponents start*/ + resetState(); + flagf = 1; + targ_velocity = speed; + targ_sita = 0.0; + sendData(7,17); + stateR = 17; + stateL = 17; + step = 8; } else if(square){ /*reset*/ sendData(7,255); } - else if(triangle){ /*set defo*/ - sendData(7,defoR); - } else if(cross){ /*stop*/ Motor_swing=0; // sita=PI/4.0,x=0.0,y=0.0; @@ -153,6 +170,12 @@ sendData(5,stateR); } } + if(triangle){ + skip = 1; + } + else if(!triangle){ + skip = 0; + } } #endif /***The function is PID controller initialize.***/