Few months ago, a guy on a forum asked for a DIY project, a pedal switcher with 3 loops. The idea was to be able to only turn on and off ONLY one loop at the time, no combination, not the traditional switcher, one loop he said !
Here’s my take on it : https://github.com/ThebigDickhead/AVR_PROG/blob/master/pedal_switcher_3.c
I added the traditional switcher fonction (otherwise the program wouldn’t be worth it), a loop in the loop (“inception” trademark ? ) The program is really simple, or stupid I could say.There’re two modes of operation visualized by a dual packaged LED and controlled by a fourth switch (mode_switch obviously).
In either mode, the µC waits for a button call and process the code associated with it.
Once the fourth switch is pressed, it makes the program enters (or exit) the while loop for the one_shot mode.
the project never really find its birth, it was just an idea, see how I’d do such thing. Although, well no millions way of doing it. Besides, the code is so small that I’d have some scruples to put it in a 4K or 16K uC, maybe adding loops and functionalities would be a great add-on and control that puppy with a remote controller.
You could go all fancy and construct an Interrupt driven program but do you really what that ?
Anyway, if It can be of use for someone in the Real Wide Wasted World…