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
Diff: Motor.cpp
- Revision:
- 2:bfdabfcb2b70
- Parent:
- 1:c75b234558af
--- a/Motor.cpp Tue Sep 07 11:21:42 2010 +0000 +++ b/Motor.cpp Mon Nov 05 14:27:39 2018 +0000 @@ -26,7 +26,7 @@ _pwm(pwm), _fwd(fwd), _rev(rev) { // Set initial condition of PWM - _pwm.period(0.001); + _pwm.period(0.002); _pwm = 0; // Initial condition of output enables