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