[SOLVED] One GPIO Button Controlling Multiple Python Tasks?
-
Now that I've managed to get my 2.2" display to turn on, display static images, and turn off, I'd like to control the backlight with a pushbutton. I already have two simple python scripts that turn the backlight on or off, but I'm not sure how to trigger something like that with a momentary button. I have seen some tutorials on how to monitor a button and do something if it's pressed but I've not seen it mentioned (or quite possibly I don't know what to look for) to have the button do one thing the first time it's pressed, another thing the second time it's pressed, and then loop back to the first task the third time it's pressed.
What sorts of things should I be searching for, or can you point me to any good tutorials?
-
I figured this out and wrote up a basic script to turn the backlight on and off for my secondary display. It's in a post in my Super Famicom build thread.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.