Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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;