return only if chosen

This commit is contained in:
Ronald Schaten 2022-02-11 22:56:18 +01:00
parent f465359eeb
commit 98080e87dd

View File

@ -69,11 +69,18 @@ void Scenerunner::_runHandler_shutter() {
digitalWrite(_pin_shutter, LOW);
digitalWrite(_pin_backlight, HIGH);
if (step >= nSteps) {
_lcd->clear();
_lcd->print("Return to start");
runStep = RUN_RETURN;
runStepStart = millis();
_stepper->startMove(- 200/8 * distance * (nSteps - 1));
if (bReturn) {
_lcd->clear();
_lcd->print("Return to start");
runStep = RUN_RETURN;
runStepStart = millis();
_stepper->startMove(- 200/8 * distance * (nSteps - 1));
} else {
_lcd->clear();
_lcd->print("Done");
runStep = RUN_OFF;
runStepStart = millis();
}
} else {
step++;
_lcd->clear();
@ -105,6 +112,10 @@ void Scenerunner::_runHandler_return() {
_lcd->print("moving ");
_lcd->print(distance * (nSteps - 1));
_lcd->print("mm");
if (_stepper->getStepsRemaining() == 0) {
runStep = RUN_OFF;
runStepStart = millis();
}
}
void Scenerunner::nextAction() {