Control an H-Bridge using a PwmOut (enable) and two DigitalOuts (direction select)
Fork of Motor by
Diff: Motor.cpp
- Revision:
- 5:71d7e9c17980
- Parent:
- 4:5370aae8ee3b
- Child:
- 6:a321d28cce9a
--- a/Motor.cpp Thu May 07 09:47:58 2015 +0000 +++ b/Motor.cpp Thu May 07 11:05:06 2015 +0000 @@ -23,8 +23,6 @@ #include "Motor.h" #include "mbed.h" -#define AUTO 1 - Motor::Motor(PinName pwm, PinName fwd, PinName rev) : _pwm(pwm), _fwd(fwd), _rev(rev), speedControl(K, Ti, Td, itv), encoder(CH_A, CH_B, NC, pPerRev) { @@ -63,6 +61,3 @@ _rev = (speed < 0.0); _pwm = abs(speed); } - - -