Example

Dependencies:   mbed

Fork of PololuQik2 by stephen smitherman

Revision:
1:1ac7b13ff4c3
diff -r 511d65ef1276 -r 1ac7b13ff4c3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 15 18:25:20 2014 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "PololuQik2.h"
+#include "CRC7.h"
+
+
+void Error()
+{
+    printf("ERROR");
+}
+
+//(PinName TxPin, PinName RxPin, PinName RSTPin, PinName errPin, void(*errorFunction)(void), bool enCRC)
+PololuQik2 driver1(p9,p10,p11,p12,&Error,0);
+
+
+
+int main()
+{
+
+    driver1.begin();
+
+
+    while (1) {
+        for(int x=0; x<=127; x++) {
+            driver1.setMotor0Speed(x);
+            driver1.setMotor1Speed(x);
+            wait(.05);
+        }
+        for(int x=127; x>=-127; x--) {
+            driver1.setMotor0Speed(x);
+            driver1.setMotor1Speed(x);
+            wait(.05);
+        }
+        for(int x=-127; x<0; x++) {
+            driver1.setMotor0Speed(x);
+            driver1.setMotor1Speed(x);
+            wait(.05);
+        }
+    }
+}
+