It's about Rasberry PI, but in this case, it doesn't matter. I have 9 functions like:
for_1..9()
These functions turn on one part of a 4-digit LED display. But I want to use a button for every number on this display, so I want to call different functions every time when I push the button. No idea how can it be.
Functions look like this:
def for_1():
GPIO.output(15.HIGH)
GPIO.output(18.HIGH)
....
Smth like this:
if Pin.input(number of pin):
for i in range(0, 9):
for_1()
#next time in loop has to be next function
foo_1,..., foo_1000, there's 98% chance you actually need alistof variables.