Add Force Brake
Diff: Motor.cpp
- Revision:
- 4:f1b54a118b5e
- Parent:
- 3:143494304b66
- Child:
- 5:1d0887244f8b
--- a/Motor.cpp Thu Dec 21 11:12:28 2017 +0000 +++ b/Motor.cpp Tue May 29 11:17:59 2018 +0000 @@ -37,7 +37,7 @@ void Motor::speed(float speed) { _fwd = (speed > (float)0.0); _rev = (speed < (float)0.0); - _pwm = abs(speed); + _pwm = fabs(speed); } void Motor::period(float period){ @@ -59,7 +59,7 @@ } -void Motor::Forcebrake(){ +void Motor::forcebrake(){ _pwm = 1.0; _fwd = 1; _rev = 1;