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.
Revision 1:cf533adb862c, committed 2020-02-24
- Comitter:
- crussell21
- Date:
- Mon Feb 24 08:34:01 2020 +0000
- Parent:
- 0:1a5f4c492b1a
- Commit message:
- inverted conditional so switch up and down are flipped to a more logical interpretation
Changed in this revision
| linearActuatorControl.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/linearActuatorControl.cpp Sun Feb 23 05:55:59 2020 +0000
+++ b/linearActuatorControl.cpp Mon Feb 24 08:34:01 2020 +0000
@@ -19,10 +19,10 @@
void LinearActuatorControl::refresh() {
if (!_controlMode) {
- _linAct1.pulsewidth_us(_actBtn1 ? (1000*(1+_manualPositionsDown[0])) : (1000*(1+_manualPositionsUp[0])));
- _linAct2.pulsewidth_us(_actBtn2 ? (1000*(1+_manualPositionsDown[1])) : (1000*(1+_manualPositionsUp[1])));
- _linAct3.pulsewidth_us(_actBtn3 ? (1000*(1+_manualPositionsDown[2])) : (1000*(1+_manualPositionsUp[2])));
- _linAct4.pulsewidth_us(_actBtn4 ? (1000*(1+_manualPositionsDown[3])) : (1000*(1+_manualPositionsUp[3])));
+ _linAct1.pulsewidth_us(!_actBtn1 ? (1000*(1+_manualPositionsDown[0])) : (1000*(1+_manualPositionsUp[0])));
+ _linAct2.pulsewidth_us(!_actBtn2 ? (1000*(1+_manualPositionsDown[1])) : (1000*(1+_manualPositionsUp[1])));
+ _linAct3.pulsewidth_us(!_actBtn3 ? (1000*(1+_manualPositionsDown[2])) : (1000*(1+_manualPositionsUp[2])));
+ _linAct4.pulsewidth_us(!_actBtn4 ? (1000*(1+_manualPositionsDown[3])) : (1000*(1+_manualPositionsUp[3])));
} else {
if (_runMode) {