- Breadboard
- Resistor(s)
- LED(s)
- Male to female wires
- Raspberry Pi Zero, screen, keyboard, mouse and adaptors to make it all work
- Make the circuit - resistor from + to one of the rows above; long LED ends to resistor rail; short LED ends to negative rail (-)
- Connect to Pi Zero - from GPIO 21 to positive on breadboard (+); from GND to negative on breadboard
- Check Pi GPIO Schematic to be sure of numbers
- Open Python 3 IDE
- Open a new file and save it with a name... e.g. led.py
- Here is a simple script
from gpiozero import LED
from time import sleep
leds_on = LED(21)
while True:
leds_on.on()
sleep(1)
leds_on.off()
sleep(1)
- Save the file
- Run the file using Run module.