Control an H-Bridge using a PwmOut (enable) and two DigitalOuts (direction select)
Fork of Motor by
Revision 3:0278c570cc5c, committed 2016-03-08
- Comitter:
- djleitch
- Date:
- Tue Mar 08 15:53:13 2016 +0000
- Parent:
- 2:f265e441bcd9
- Commit message:
- ES309 Code
Changed in this revision
Motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f265e441bcd9 -r 0278c570cc5c Motor.cpp --- a/Motor.cpp Tue Nov 23 16:16:43 2010 +0000 +++ b/Motor.cpp Tue Mar 08 15:53:13 2016 +0000 @@ -28,7 +28,7 @@ _pwm(pwm), _fwd(fwd), _rev(rev) { // Set initial condition of PWM - _pwm.period(0.001); + _pwm.period(1.0/20.0e3); _pwm = 0; // Initial condition of output enables