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.
Dependencies: PID QEI ikarashiMDC recieveController omni
Revision 24:050d78bb5b69, committed 2017-11-22
- Comitter:
- WAT34
- Date:
- Wed Nov 22 18:10:49 2017 +0900
- Parent:
- 22:d7c3bd1ce8f8
- Child:
- 25:fd4fb86b4148
- Commit message:
- ps3 edition
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Nov 17 18:04:41 2017 +0900 +++ b/main.cpp Wed Nov 22 18:10:49 2017 +0900 @@ -60,27 +60,27 @@ while(true) { modeStatus = 15-modeChange.read(); - if((con.buttons[0] >>9)%2 ) + if((con.buttons[0] >>7)%2 ) { boom.fire(); } - if((con.buttons[0] >>10)%2) + if((con.buttons[0] >>8)%2) boom.setTargetMotorSpeed(flywheelspeed); else boom.setTargetMotorSpeed(0); - if((con.buttons[0]>>12)%2) //square + if((con.buttons[0]>>3)%2) //square angle = 80; - if((con.buttons[0]>>14)%2) //cross + if((con.buttons[0]>>4)%2) //cross angle = 45; - if((con.buttons[0]>>13)%2) //circle + if((con.buttons[0]>>5)%2) //circle angle = 25; - if((con.buttons[0]>>11)%2) //triangle + if((con.buttons[0]>>6)%2) //triangle angle = 10; - if((con.buttons[0]>>2)%2 ) + if((con.buttons[0]>>13)%2 ) { if(!prevSwing) fishingPole.toggleSwing(); @@ -88,13 +88,13 @@ }else{ prevSwing = false; } - if(con.buttons[4] < 117 ) + if(con.buttons[3] < 117 ) { if(!prevAnglechange) angle += 2.5; prevAnglechange =true; }else - if(con.buttons[4] > 137) + if(con.buttons[3] > 137) { if(!prevAnglechange) angle -= 2.5; @@ -109,22 +109,22 @@ angle = 90; } - if((con.buttons[3] >50)) - turnRate = con.buttons[3]/500.0; - else if((con.buttons[6]/4080 > 50)) - turnRate = -(con.buttons[6]/4080)/500.0; + if((con.buttons[0] >> 9)%2) + turnRate =-.2; //turn at .2 power + else if((con.buttons[0] >> 10)%2) + turnRate = .2; else turnRate = 0; - if((con.buttons[0]%2)) + if((con.buttons[0]>>14%2)) angling = -0.4; - else if((con.buttons[0]>>1)%2) + else if((con.buttons[0])%2) angling = 0.2; else angling = 0; fishingPole.setAnglingSpeed(angling); - if((con.buttons[0]>>8)%2) + if((con.buttons[0]>>15)%2) fishingPole.Deploy(); update();