From c78aae8aedad17433a7d638423d1cfd38b6237de Mon Sep 17 00:00:00 2001 From: Ronald Schaten Date: Thu, 10 Feb 2022 00:45:08 +0100 Subject: [PATCH] added class for scene runner --- PhotoStepper/PhotoStepper.ino | 27 +++++++++++---------------- PhotoStepper/Scenerunner.cpp | 10 ++++++++++ PhotoStepper/Scenerunner.h | 29 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 PhotoStepper/Scenerunner.cpp create mode 100644 PhotoStepper/Scenerunner.h diff --git a/PhotoStepper/PhotoStepper.ino b/PhotoStepper/PhotoStepper.ino index 4f40999..70bca6a 100644 --- a/PhotoStepper/PhotoStepper.ino +++ b/PhotoStepper/PhotoStepper.ino @@ -17,6 +17,7 @@ #include #include #include +#include "Scenerunner.h" // analog keypad #define PIN_BUTTON A0 @@ -61,6 +62,8 @@ BasicStepperDriver stepper(STEPPER_STEPS, PIN_STEPPER_DIR, PIN_STEPPER_STEP); enum State { STATE_MENU, STATE_JOG, STATE_RUN }; State state = STATE_MENU; +Scenerunner scenerunner; + void lcd_print(int line, String string) { Serial.print("lcd_print("); Serial.print(line); @@ -94,38 +97,29 @@ result enter_run() { return proceed; } -int tSettle = 100; -int tFocus = 500; -int tShutter = 500; -bool bReturn = true; -bool bDarkenLcd = true; - -TOGGLE(bReturn, setReturn, "Return: ", doNothing, noEvent, wrapStyle +TOGGLE(scenerunner.bReturn, setReturn, "Return: ", doNothing, noEvent, wrapStyle ,VALUE("On", true, doNothing, noEvent) ,VALUE("Off", false, doNothing, noEvent) ); -TOGGLE(bDarkenLcd, setLcdBlackout, "DarkenLCD: ", doNothing, noEvent, wrapStyle +TOGGLE(scenerunner.bDarkenLcd, setLcdBlackout, "DarkenLCD: ", doNothing, noEvent, wrapStyle ,VALUE("On", true, doNothing, noEvent) ,VALUE("Off", false, doNothing, noEvent) ); MENU(configuration, "Configuration", doNothing, anyEvent, wrapStyle - ,FIELD(tSettle, "tSettle", "ms", 0, 2000, 100, 10, doNothing, noEvent, wrapStyle) + ,FIELD(scenerunner.tSettle, "tSettle", "ms", 0, 2000, 100, 10, doNothing, noEvent, wrapStyle) ,EXIT("