motor

Dependencies:   VNH5019 mbed

Revision:
0:974de11b1491
Child:
1:6ad72ace0fec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 15 02:09:45 2016 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "VNH5019.h"
+
+VNH5019 motorShield(p23,p22,p25,p21,p24,p26);
+Serial pc(USBTX, USBRX);
+Serial xbee(p13, p14);
+
+int main()
+{
+
+    char c;
+
+    while(true) {
+        c = xbee.getc();
+
+        if(c == 'f') {
+            motorShield.changeSpeed(1, 255, 1, 255);
+        }
+        
+        if(c == 'b'){
+            motorShield.changeSpeed(2, 255, 2, 255);
+        }
+        
+        if(c == 'l'){
+            motorShield.changeSpeed(0, 255, 1, 255);
+        }
+        
+        if(c == 'r') {
+            motorShield.changeSpeed(1, 255, 0, 255);
+        }
+
+        if(c == 's') {
+            motorShield.changeSpeed(0, 255, 0, 255);
+        }
+    }
+    return 0;
+}
\ No newline at end of file