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.
Fork of MotorDriver by
Diff: MotorDriver.cpp
- Revision:
- 3:7a6365365ee2
- Parent:
- 1:15e17abb9f29
--- a/MotorDriver.cpp Thu Apr 28 02:00:07 2016 +0000
+++ b/MotorDriver.cpp Thu Apr 28 02:38:16 2016 +0000
@@ -3,7 +3,6 @@
#include <cmath>
// See .h file for function descriptions and details
-
MotorDriver::MotorDriver(DigitalOut in1, DigitalOut in2, PwmOut pwm, float pwmFreq, bool isBrakeable)
: _in1(in1), _in2(in2), _pwm(pwm)
{
@@ -43,14 +42,14 @@
(bool)((speed < 0.0f) && (motor_state.code == DRIVING_CW) && (_pwm > 0.05f)) ||
(bool)((speed > 0.0f) && (motor_state.code == DRIVING_CCW)&& (_pwm > 0.05f));
if(isTryingToInstantReverse) {
- // Set motor to brake, set state to error
+ // Set motor to brake, set state to error
coast();
motor_state.code = MOTOR_ERROR;
motor_state.value = _pwm;
return motor_state;
} else {
if(speed == 0.0f) {
- // No effect to _in pins
+ // No effect to _in pins
} else {
_in1 = (speed>0.0f);
_in2 = (speed<0.0f);
