Compatible with TB6612FNG motor driver

Dependents:   MobileArcade

Revision:
3:45035c94addb
Parent:
2:f265e441bcd9
--- a/Motor.cpp	Tue Nov 23 16:16:43 2010 +0000
+++ b/Motor.cpp	Tue Dec 11 06:32:10 2018 +0000
@@ -32,8 +32,8 @@
     _pwm = 0;
 
     // Initial condition of output enables
-    _fwd = 0;
-    _rev = 0;
+    _fwd = 1;
+    _rev = 1;
 }
 
 void Motor::speed(float speed) {
@@ -42,5 +42,8 @@
     _pwm = abs(speed);
 }
 
-
-
+void Motor::brake(int shortBrake) {
+    _fwd = shortBrake;
+    _rev = shortBrake;
+    _pwm = 0;
+}