Ok so if I, a novice at Arduino, am going to go this route I am going to have to re-write everything.
You have the algorithm already in your head ![]()
I almost wonder if I should simply incorporate a "power switch", physically, into this unit which is the on / start or reset/off to ease this rather than a state machine?
You're in control.