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:
- 61:e018207ae860
- Parent:
- 60:4a75f3f3a934
- Child:
- 63:dad3f4e5e99c
--- a/autoMode.h Fri Oct 02 07:24:52 2015 +0000 +++ b/autoMode.h Sat Oct 03 00:52:21 2015 +0000 @@ -24,19 +24,26 @@ wait(0.1); stateR = defoR; stateL = defoL; + step = 0; + CMode = 0; } + else if(b==8){ /*middle start*/ + targ_velocity=speed; + sendData(5,13); + wait(0.1); + sendData(4,13); + wait(0.1); + stateR = 13; + stateL = 13; + step = 4; + CMode = 6; + } else if(b==5){ /*reset*/ sendData(4,31); wait(0.1); sendData(5,31); wait(0.1); } - else if(b==8){ /*set defo*/ - sendData(5,defoR); - wait(0.1); - sendData(4,defoL); - wait(0.1); - } else if(b==9){ /*stop*/ Motor_swing=0; sita=PI/4.0,x=0.0,y=0.0; @@ -91,14 +98,25 @@ } else if(up){ /*start*/ targ_velocity=speed; -// sendData(5,defoR); - sendData(5,13); + sendData(5,defoR); wait(0.1); -// sendData(4,defoL); - sendData(4,13); + sendData(4,defoL); wait(0.1); stateR = defoR; stateL = defoL; + step = 0; + CStep = 1; + } + else if(right){ /*middle start*/ + targ_velocity=speed; + sendData(5,13); + wait(0.1); + sendData(4,13); + wait(0.1); + stateR = 13; + stateL = 13; + step = 4; + CStep = 6; } else if(square){ /*reset*/ sendData(4,31); @@ -123,7 +141,7 @@ else if(l1){ /*L up*/ if(edge_l1){ edge_l1=0; - if(stateL!=2) stateL--; + if(stateL!=1) stateL--; sendData(4,stateL); } } @@ -137,7 +155,7 @@ else if(r1){ /*R up*/ if(edge_r1){ edge_r1=0; - if(stateR!=2) stateR--; + if(stateR!=1) stateR--; sendData(5,stateR); } }