Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass

JeffersGlass/gpio_button.py Secret

Created Aug 30, 2020
Embed
What would you like to do?
from gpiozero import LED, Button
redLed = LED(20)
yellowLed = LED(21)
myButton = Button(16)
while(True):
if myButton.is_pressed:
redLed.off()
yellowLed.on()
else:
redLed.on()
yellowLed.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.