pass stepper to scenerunner()
This commit is contained in:
parent
431494723d
commit
df80dfe5c1
@ -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(&lcd);
|
||||
Scenerunner scenerunner(&lcd, &stepper);
|
||||
|
||||
// ===
|
||||
// Order of menu entries looks chaotic. It makes sense on screen.
|
||||
|
@ -1,10 +1,12 @@
|
||||
#include "Arduino.h"
|
||||
#include <LiquidCrystal.h>
|
||||
#include <BasicStepperDriver.h>
|
||||
|
||||
#include "Scenerunner.h"
|
||||
|
||||
Scenerunner::Scenerunner(LiquidCrystal *lcd) {
|
||||
Scenerunner::Scenerunner(LiquidCrystal *lcd, BasicStepperDriver *stepper) {
|
||||
_lcd = lcd;
|
||||
_stepper = stepper;
|
||||
}
|
||||
|
||||
void Scenerunner::nextAction(){
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <LiquidCrystal.h>
|
||||
#include <BasicStepperDriver.h>
|
||||
|
||||
class Scenerunner {
|
||||
|
||||
@ -18,11 +19,12 @@ class Scenerunner {
|
||||
int nSteps = 10;
|
||||
float distance = 0.5;
|
||||
|
||||
Scenerunner(LiquidCrystal *lcd);
|
||||
Scenerunner(LiquidCrystal *lcd, BasicStepperDriver *stepper);
|
||||
void nextAction();
|
||||
|
||||
private:
|
||||
LiquidCrystal *_lcd;
|
||||
BasicStepperDriver *_stepper;
|
||||
enum RunStep { RUN_OFF, RUN_SETTLE, RUN_FOCUS, RUN_SHUTTER, RUN_RETURN };
|
||||
RunStep runStep = RUN_OFF;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user