pass LCD to scenerunner()

This commit is contained in:
Ronald Schaten 2022-02-10 14:53:35 +01:00
parent c78aae8aed
commit e574248a7f
3 changed files with 8 additions and 4 deletions

View File

@ -62,7 +62,7 @@ BasicStepperDriver stepper(STEPPER_STEPS, PIN_STEPPER_DIR, PIN_STEPPER_STEP);
enum State { STATE_MENU, STATE_JOG, STATE_RUN };
State state = STATE_MENU;
Scenerunner scenerunner;
Scenerunner scenerunner(&lcd);
void lcd_print(int line, String string) {
Serial.print("lcd_print(");

View File

@ -1,8 +1,10 @@
#include "Arduino.h"
#include <LiquidCrystal.h>
#include "Scenerunner.h"
Scenerunner::Scenerunner() {
// TODO: initialize
Scenerunner::Scenerunner(LiquidCrystal *lcd) {
_lcd = lcd;
}
void Scenerunner::nextAction(){

View File

@ -2,6 +2,7 @@
#define Scenerunner_h
#include "Arduino.h"
#include <LiquidCrystal.h>
class Scenerunner {
@ -17,10 +18,11 @@ class Scenerunner {
int nSteps = 10;
float distance = 0.5;
Scenerunner();
Scenerunner(LiquidCrystal *lcd);
void nextAction();
private:
LiquidCrystal *_lcd;
enum RunStep { RUN_OFF, RUN_SETTLE, RUN_FOCUS, RUN_SHUTTER, RUN_RETURN };
RunStep runStep = RUN_OFF;