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:
- 6:62d498ee97cf
- Parent:
- 4:adc885f4ab75
- Child:
- 7:3b2cf7efe5d1
diff -r 74c8ce39334b -r 62d498ee97cf main.cpp --- a/main.cpp Sun Nov 17 21:48:30 2013 +0000 +++ b/main.cpp Mon Nov 18 23:45:12 2013 +0000 @@ -26,8 +26,12 @@ targetAngle = bot.gyro.getZDegrees(); break; case 'w': - bot.left.setPower(0.2); - bot.right.setPower(0.2); + bot.driveForward(-90,0); + DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); + break; + case 'x': + bot.driveForward(90,0); + DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'W': bot.driveForward(targetAngle,1000); @@ -46,12 +50,12 @@ DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'a': - bot.left.setPower(-0.1); - bot.right.setPower(0.2); + bot.driveForward(180,0); + DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'd': - bot.left.setPower(0.2); - bot.right.setPower(0.1); + bot.driveForward(0,0); + DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'p': DBGPRINT("%d\r\n",bot.gyro.getZ());