Last active
December 28, 2015 22:56
-
-
Save KramKroc/ed3bbae1ad1b383999e6 to your computer and use it in GitHub Desktop.
Lights with gpio
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 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