How to exit this program once the button has been pressed?
I am trying to get this code to exit once the button has been pressed and cant get it to work with break or exit.
print("Here we go! Press CTRL+C to exit")
time.sleep(3) # Debounce button press
except KeyboardInterrupt: # If CTRL+C is pressed, exit cleanly:
button._freeGpio()# cleanup all GPIO
Oh I forgot to mention it is an autorun program to start on boot.