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:
- 18:c834bd26869e
- Parent:
- 17:e247d58d9f42
- Child:
- 23:53cafcd67828
--- a/main.cpp Tue Mar 11 20:22:18 2014 +0000 +++ b/main.cpp Wed Mar 12 21:58:30 2014 +0000 @@ -56,7 +56,8 @@ DBGPRINT("BB\n\r",1); leds = leds^0x7; // toggle the LEDs for each loop tmpchar = pc.getc(); - + int testdata[]={'H','e','l','l','o'}; + int response; // all of these movement commands are blocking, so they can't be easily stopped short of resetting the microcontroller switch(tmpchar){ /*case 'e': //drive in a smallish square @@ -95,8 +96,7 @@ break; case 'd': // turn back to starting rotation //bot.driveForward(0,0); - int testdata[]={'H','e','l','l','o'}; - int response=bot.BTLink.sendCmd(0x02,testdata,5); + response=bot.BTLink.sendCmd(0x02,testdata,5); DBGPRINT("=%d\n\r",response); break; case 'W': // drive forward a small bit @@ -132,24 +132,30 @@ // these are all control system modifications which should be fairly well locked down at this point case 't': - bot.pfac*=2; - DBGPRINT("pfac = %f\r\n",bot.pfac); + response=bot.BTLink.sendCmd(0x00,testdata,5); + //bot.pfac*=2; + //DBGPRINT("pfac = %f\r\n",bot.pfac); + DBGPRINT("=%d, %d\n\r",response,bot.BTLink.bufSize()); break; case 'g': bot.pfac/=2; DBGPRINT("pfac = %f\r\n",bot.pfac); break; case 'y': - bot.ifac*=2; - DBGPRINT("ifac = %f\r\n",bot.ifac); + response=bot.BTLink.sendCmd(0x01,testdata,5); + //bot.ifac*=2; + //DBGPRINT("ifac = %f\r\n",bot.ifac); + DBGPRINT("=%d, %d\n\r",response,bot.BTLink.bufSize()); break; case 'h': bot.ifac/=2; DBGPRINT("ifac = %f\r\n",bot.ifac); break; case 'u': - bot.dfac*=2; - DBGPRINT("dfac = %f\r\n",bot.dfac); + response=bot.BTLink.sendCmd(0x02,testdata,5); + //bot.dfac*=2; + //DBGPRINT("dfac = %f\r\n",bot.dfac); + DBGPRINT("=%d, %d\n\r",response,bot.BTLink.bufSize()); break; case 'j': bot.dfac/=2;