I have a marble machine door bell dinger which is designed to react to a button push (door bell outside).
I'm having real trouble working out how to get the loops working correctly with AccelStepper.
Im not completely new to arduino and have done a number of projects before, but this was a few years back! I'm resisting to ask for code i want to learn why I cant work this out! instead of just copy and pasting bits from all over the internet like most of my other projects!
I am running AccelStepper which my trial and error tells me needs to loop stepper.run which is what is throwing me.
I'd like a button press to.... (in sequence)
- turn on a light
- shuffle my servo left then right 5 times
wait 5 seconds
- run stepper forwards x rotations, then back x rotations to the start,
wait 5 sec
- turn off light
then ready to read a button press again.
While the loop is running I don't want the button press to in
For some reason I can't work out the loop structure.
If it matters I'm using, stepper.moveTo with different accel and speed for forward and reverse.
Any guidance on the structure i could use would be much appreciated