Skip to content

Instantly share code, notes, and snippets.

@KramKroc
Last active December 28, 2015 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KramKroc/ed3bbae1ad1b383999e6 to your computer and use it in GitHub Desktop.
Save KramKroc/ed3bbae1ad1b383999e6 to your computer and use it in GitHub Desktop.
Lights with gpio
from gpiozero import LED, Button
from time import sleep
red_led = LED(4)
yellow_led = LED(17)
blue_led = LED(23)
button = Button(25)
yellow_led.blink()
while True:
if button.is_pressed:
red_led.on()
blue_led.off()
else:
red_led.off()
blue_led.on()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment