Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Revision:
8:a0760acdc59e
Child:
12:5790e56a056f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/motor.cpp	Fri May 05 01:21:33 2017 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "motor.h"
+
+void Motor::backward(double voltage) {
+    forw.write(voltage);
+    back.write(0);
+}
+
+void Motor::forward(double voltage) {
+    forw.write(0);
+    back.write(voltage);
+}
+
+
+void Motor::brake() {
+    forw.write(BRAKE_VOLTAGE);
+    back.write(BRAKE_VOLTAGE);
+}
+
+void Motor::coast() {
+    forw.write(0);
+    back.write(0);
+}
\ No newline at end of file