Basic tank-style drive robot control firmware for Freescale FRDM-K64F. Controls motors on a Dual-Full-H-Bridge with EN, like DBH-1x series, from Bluetooth serial commands

Dependencies:   mbed

Revision:
4:7620d21baef3
Parent:
3:502f90649834
--- a/main.cpp	Thu Aug 13 17:50:28 2015 +0000
+++ b/main.cpp	Sun Aug 16 22:46:25 2015 +0000
@@ -97,7 +97,7 @@
   float cr, cl;
   cr = MotR.getCurrent();
   cl = MotL.getCurrent();
-  CmdSerial.printf("\tCurrent:  left=%.3f  right=%.3f\r\n",cl,cr);
+  DiagSerial.printf("\tCurrent:  left=%.3f  right=%.3f\r\n",cl,cr);
 }
 
 //void dumpSerialChar()
@@ -119,10 +119,12 @@
 
 int main()
 {
+    DiagSerial.baud(115200);   DiagSerial.puts("TankDrive Diagnostics\r");
+
+    // have been getting lock-ups when running app.  could 57600 be too fast for BT UART on K64F?
     CmdSerial.baud(57600);
     CmdSerial.puts("\r\nTankDrive for K64F with Bluetooth\r\n\n");
     CmdSerial.attach(&gotChar);  // singleton serial character buffer
-    DiagSerial.baud(115200);   DiagSerial.puts("TankDrive Diagnostics\r");
     
     // Set motor drive parameters
     initMotorDrive(MotL);