ing state machine (IDLE, HOMING, MOVING, STOPPED, ERROR)
* - Endstop (D7) with debounce via ISR + softwa... enum class State { IDLE, HOMING, MOVING, STOPPED, ERROR };
volatile State state = State::IDLE;
// Flags
... / state machine
static State lastState = State::ERROR; // force initial print
if (lastState != state)... MOVING:
// run down until pulses reached or error
servoDown();
{
long goal = (l