Last active
June 28, 2019 14:56
-
-
Save rbricheno/d015ce8cd466cf2902bbbae5309ec740 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 guizero import App, Text | |
from gpiozero import Button | |
button = Button(2) | |
app = App(title="Hello GPIO") | |
message = Text(app, text="Waiting for first update") | |
def update_button(): | |
if button.is_pressed: | |
message.value = "Button is pressed" | |
else: | |
message.value = "Button is not pressed" | |
# Update every 100ms, you might want to go faster. | |
text.repeat(100, update_button) | |
app.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment