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:
- 42:28d73a7c624e
- Parent:
- 41:fa498d6e7538
- Child:
- 43:f7ef0f5f980c
diff -r fa498d6e7538 -r 28d73a7c624e main.cpp --- a/main.cpp Mon Mar 31 02:29:46 2014 +0000 +++ b/main.cpp Mon Mar 31 19:44:10 2014 +0000 @@ -45,6 +45,8 @@ s3.toPosition(45); s4.toPosition(45); + int s1pos = 45; + int s2pos = 45; //timer issue navigation test bot.absDriveForward(0,50);//assuming the bot stops in this function @@ -93,12 +95,12 @@ break; case 'w': // turn 90 degrees counter clockwise from the starting rotation - s.toPosition(0); + s.toPosition(-40); //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': // turn 90 degrees clockwise from the starting rotation - s.toPosition(180); + s.toPosition(220); //bot.driveForward(-90,0); DBGPRINT("={%f,\t%f,\t%f}\n\r",bot.x,bot.y,bot.rot*180.0/3.14159); break; @@ -214,20 +216,20 @@ //DBGPRINT("pfac = %f\r\n",bot.pfac); break; case 'Y': - //bot.ifac*=1.05; - //DBGPRINT("ifac = %f\r\n",bot.ifac); + s.toPosition(s1pos+=5); + DBGPRINT("1 pos = %d\r\n",s1pos); break; case 'H': - //bot.ifac/=1.05; - //DBGPRINT("ifac = %f\r\n",bot.ifac); + s.toPosition(s1pos-=5); + DBGPRINT("1 pos = %d\r\n",s1pos); break; case 'U': - //bot.dfac*=1.05; - //DBGPRINT("dfac = %f\r\n",bot.dfac); + s2.toPosition(s2pos+=5); + DBGPRINT("2 pos = %d\r\n",s2pos); break; case 'J': - //bot.dfac/=1.05; - //DBGPRINT("dfac = %f\r\n",bot.dfac); + s2.toPosition(s2pos-=5); + DBGPRINT("2 pos = %d\r\n",s2pos); break; // poll the compass ( currently gives bad values )