Control a DC motor via a standard H-bridge using a PwmOut pin to control speed and two DigitalOut pins to control direction. Can change pwm period on the PwmOut pin, and also brake high or low.

Fork of Motor by Aaron Berk

Files at this revision

API Documentation at this revision

Comitter:
javierjsp
Date:
Tue Apr 11 19:55:45 2017 +0000
Parent:
1:c75b234558af
Commit message:
changed default brake to low

Changed in this revision

Motor.h Show annotated file Show diff for this revision Revisions of this file
diff -r c75b234558af -r e138b2d99454 Motor.h
--- a/Motor.h	Tue Sep 07 11:21:42 2010 +0000
+++ b/Motor.h	Tue Apr 11 19:55:45 2017 +0000
@@ -63,7 +63,7 @@
      * Brake to GND => inA = inB = 0
      * Brake to VCC => inA = inB = 1
      */
-    void brake(int highLow = BRAKE_HIGH);
+    void brake(int highLow = BRAKE_LOW);
 
 protected:
     PwmOut _pwm;