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 IEEE_14_Freescale by
Diff: main.cpp
- Revision:
- 44:4b933e7409e7
- Parent:
- 43:f7ef0f5f980c
- Child:
- 45:9c520ebc38e0
--- a/main.cpp Mon Mar 31 21:54:34 2014 +0000 +++ b/main.cpp Tue Apr 01 02:16:35 2014 +0000 @@ -40,8 +40,8 @@ DBGPRINT("AA\n\r",1); // to see if robot powers up at least //test servo - s.toPosition(45); - s2.toPosition(45); + s.toPosition(-45); + s2.toPosition(60); s3.toPosition(45); s4.toPosition(45); @@ -50,6 +50,8 @@ //timer issue navigation test bot.absDriveForward(0,50);//assuming the bot stops in this function + + bot.gyro.stop();//stopping the gyro timer /* DBGPRINT("%f",bot.gyro.getZDegrees()); bot.gyro.stop();//stopping the gyro timer @@ -206,7 +208,25 @@ break; case 'T': DBGPRINT("Finding Gap\r\n",1); - game.checkWaves(); + s.toPosition(-45); + s2.toPosition(60); + wait(0.5); + s2.toPosition(-10); + wait(0.5); + //bot.cont.start(); + bot.cont.resetTicks(); + bot.cont.rampSpeed(-20,-20); + //s.toPosition(0); + //wait(.5); + while(bot.cont.avgTicks()>-900){ + s.toPosition((-45)+((35+45)*(-bot.cont.avgTicks()))/900); + wait_ms(20); + } + bot.cont.rampSpeed(0,0); + s.toPosition(130); + while(!bot.cont.stopped()); + //bot.cont.stop(); + //game.checkWaves(); break; case 'G': DBGPRINT("Running First and Second Row\r\n",1); @@ -216,13 +236,14 @@ //DBGPRINT("pfac = %f\r\n",bot.pfac); break; case 'Y': - bot.cont.start(); + /*bot.cont.start(); bot.cont.rampSpeed(40,40); - wait(2); + while(!bot.cont.steady()); bot.cont.rampSpeed(0,0); - wait(2); - bot.cont.stop(); + while(!bot.cont.stopped()); + bot.cont.stop();*/ //s.toPosition(s1pos+=5); + bot.alignWithRig(); DBGPRINT("1 pos = %d\r\n",s1pos); break; case 'H':