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:
- 10:926f142f16a3
- Parent:
- 9:aff48e331147
- Child:
- 11:967469d7e01c
diff -r aff48e331147 -r 926f142f16a3 main.cpp --- a/main.cpp Mon Feb 03 20:37:35 2014 +0000 +++ b/main.cpp Wed Feb 12 05:38:52 2014 +0000 @@ -11,6 +11,7 @@ char tmpchar = 0; leds = 0x2; const int* constbuf; + int tmpOut; double targetAngle=0.0; while(1) { DBGPRINT("BB\n\r",1); @@ -55,16 +56,21 @@ break; case 'W': // drive forward a small bit //bot.driveForward(targetAngle,1000); - bot.motors.moveForward(100); - DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); + //bot.motors.moveForward(100); + tmpOut = bot.absDriveForward(targetAngle,1000); + DBGPRINT("W -> %d\n\r",tmpOut); + //DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'E': //drive forward five times as much bot.driveForward(targetAngle,5000); DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; case 'X': // small reverse - bot.driveForward(targetAngle,-1000); - DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); + //bot.driveForward(targetAngle,-1000); + //DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); + + tmpOut = bot.absDriveForward(targetAngle,3000); + DBGPRINT("X -> %d\n\r",tmpOut); break; case 'C': // big reverse bot.driveForward(targetAngle,-5000);