Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass

JeffersGlass/gpio_basic.py Secret

Created Aug 30, 2020
Embed
What would you like to do?
from gpiozero import LED
from time import sleep
from datetime import datetime
redLed = LED(20)
yellowLed = LED(21)
greenLed = LED(12)
#turn red LED on and off
redLed.on()
sleep(1)
redLed.off()
sleep(1)
#turn yellow LED on and off
yellowLed.on()
sleep(1)
yellowLed.off()
sleep(1)
#blink green LED
greenLed.blink()
sleep(5)
print("Program ended at " + str(datetime.now()))
redLed.off()
yellowLed.off()
greenLed.off()
redLed.on()
yellowLed.on()
greenLed.on()
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.