Control an H-Bridge using a PwmOut (enable) and two DigitalOuts (direction select)
Fork of Motor by
Diff: Motor.cpp
- Revision:
- 8:d192b38e0d5c
- Parent:
- 7:d25073d59616
- Child:
- 10:f22e6393af83
--- a/Motor.cpp Wed May 13 16:25:05 2015 +0000 +++ b/Motor.cpp Thu May 14 10:49:48 2015 +0000 @@ -24,7 +24,7 @@ #include "mbed.h" Motor::Motor(PinName pwm, PinName fwd, PinName rev, PinName stby) : -_pwm(pwm), _fwd(fwd), _rev(rev), _stdby(stby), speedControl(K, Ti, Td, itv)//, encoder(CH_A, CH_B, NC, pPerRev) +_pwm(pwm), _fwd(fwd), _rev(rev), _stdby(stby)//, speedControl(K, Ti, Td, itv)//, encoder(CH_A, CH_B, NC, pPerRev) { // Set initial condition of PWM @@ -36,9 +36,9 @@ _rev = 0; //PID config - speedControl.setInputLimits(0, 1); - speedControl.setOutputLimits(0, 1); - speedControl.setMode(AUTO); + //speedControl.setInputLimits(0, 1); + //speedControl.setOutputLimits(0, 1); + //speedControl.setMode(AUTO); }