From 68b866a25e12da681708045b9fe7087e7a504d71 Mon Sep 17 00:00:00 2001 From: HamdiHaering <89581611+HamdiHaering@users.noreply.github.com> Date: Thu, 26 Aug 2021 16:57:59 +0200 Subject: [PATCH] Run Function when we launch the Run function, we have to return the value that describes the result of the runSpeed function. --- src/AccelStepper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AccelStepper.cpp b/src/AccelStepper.cpp index 093d56d..a139e3b 100644 --- a/src/AccelStepper.cpp +++ b/src/AccelStepper.cpp @@ -182,8 +182,11 @@ void AccelStepper::computeNewSpeed() // returns true if the motor is still running to the target position. boolean AccelStepper::run() { - if (runSpeed()) + if (runSpeed()){ computeNewSpeed(); + }else{ + return false; + } return _speed != 0.0 || distanceToGo() != 0; }