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
Revision 2:e138b2d99454, committed 2017-04-11
- 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;