Hi everyone,
Just before we start I know there's a simple solution to this but I'm currently tired from writing the rest of the program.
Now, I've got a program I want to stop, then start again with two separate button presses. This is what I've got so far:
But all this does, after the momentary button is pressed, is immediately restart the program instead of waiting/freezing.
Any improvement is appreciated .
electron_misfire:
But all this does, after the momentary button is pressed, is immediately restart the program instead of waiting/freezing.
I don't understand what you mean by "immediately restart the program instead of waiting/freezing."
You need to show all of the code!
Your button sets onOff to false and I see nothing that will change that, therefore it should stay in that state. Since it isn't behaving the way you want there must be some code setting onOff back to true, or ignoring the fact that it is false.
electron_misfire:
but I'm currently tired from writing the rest of the program.
Not sure how to read into this...
How does your program know it has to start again? There is no code here to start...
Also, if you put a Serial output in there to let you know it works, you'll get more insight.