I’ve been trying to work out this afternoon how to solve this problem.
I have a Nano using Nick Gammon’s switch manager library (which is awesome) managing inputs from four switches.
SW1 determines how many participants take part in something and determines how many items they paid for (possibly optional - may actually be redundant) eg SW 1 pressed 4 times equals four participants and 40 items for a total of 160.
SW2 Start/Stop - sets a variable either 1 or 0
SW3 is repeat - move back one step (could be difficult)
SW4 releases the item they paid for
I want to set up a loop that repeats as per the following flow chart. I’ve had a few different variations partially running today but just can’t seem to put it all together. Head’s a bit unclear on advantages of do - while, while, if else. I’ve tried combinations but can’t hit on the right one. Any help appreciated.