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: manualMode.h
- Revision:
- 83:e1638c58e1f1
- Parent:
- 79:7f86e18f40ef
- Child:
- 84:919a335ac81e
diff -r 7e24b99b9b61 -r e1638c58e1f1 manualMode.h --- a/manualMode.h Sun Oct 11 07:42:18 2015 +0000 +++ b/manualMode.h Mon Oct 12 06:15:45 2015 +0000 @@ -13,11 +13,11 @@ Move_r(-0.4); } else { - if(X>6) { + if(X<2) { Move_l(0.6); Move_r(0.6); - } else if(X<2) { - Move_l(-0.6); + } else if(X>6) { + Move_l(-0.61); Move_r(-0.6); } else { Move_l(0.0); @@ -33,33 +33,36 @@ autoflag=1; Indicator4=1; IndicatorAuto=0; + resetState(); } } - else if(b==6){ - targSwingRadVelocity = swingspeed; + else if(b==8){ + if(edge8){ + edge8=0; + if(targSwingRadVelocity == 0.0) targSwingRadVelocity = swingspeed; + else { + targSwingRadVelocity = 0.0; + contSwing.reset(); + } + } /*for(float i=0.0;i<1.0;i+=0.01){ Motor_swing=i; wait(0.05); } Motor_swing = 1.0;*/ } - /*else if(b==5){ - if(edge5){ - edge5=0; + else if(b==9){ + if(edge9){ + edge9=0; enableShoot=1; } - }*/ + } else if(b==5){ sendData(1,5); } - else if(b==7){ + else if(b==6){ sendData(1,4); } - else if(b==9){ - targSwingRadVelocity = 0.0; - contSwing.reset(); -// Motor_swing = 0.0; - } else if(b==1){ /*L down*/ if(edge1){ edge1=0; @@ -94,6 +97,8 @@ if(b!=3) edge3=1; if(b!=4) edge4=1; if(b!=5) edge5=1; + if(b!=8) edge8=1; + if(b!=9) edge9=1; } #else void manualMovePS3() @@ -126,6 +131,7 @@ autoflag=1; Indicator4=1; IndicatorAuto=0; + resetState(); } } else if(triangle){