Blink an LED with GPIO¶
Wire an LED and a 330 Ω resistor to GPIO 17, then blink it from Python using gpiozero.
TODO
Add a wiring diagram to images/.
Starter code¶
blink.py
# Blink an LED on GPIO 17: on for one second, off for one second, forever.
from time import sleep
from gpiozero import LED
led = LED(17)
while True:
# TODO: turn the LED on, wait 1 second, turn it off, wait 1 second
pass
Solution
Run it on the Pi:
Press Ctrl+C to stop.