Hi I have tried to self help but am possibly googling the wrong things. I am trying to create a dosing pump sketch and have 4 peristaltic pumps. My sketch is huge as it is part of a more involved controller however I want to create a touch screen button and when I push it, it includes the selected pump in a schedule. I know how to activate an input/output when I push the coords but how can I cycle though states easily? Am I looking to create a finite state machine??
For example I would have dosing pump 1 with a fill circle beside it that is red, pushing it turns it green and then that particular pumps dosing and on/off times would be included in a schedule. If I push the circle beside pump 2, that one would also be included in the schedule. So at any stage I could have any combination of the 4 pumps included or excluded.
My question is, what is the best way to organize the states of the pumps so its easy to code. I cannot seem to find examples of what I am looking to do because I think I am searching for the wrong definitions.