Created
July 9, 2017 23:24
-
-
Save bennuttall/fbf90b3712106a60512e5df2f803a0e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gpiozero import Button | |
def exit(): | |
global running | |
running = False | |
btn = Button(2, hold_time=5) | |
btn.when_held = exit | |
running = True | |
while running: | |
pass # or do something interesting here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment