Let's think about this for a second
This practice set isn't about new concepts — it's designed to help you re-practice LED wiring, GPIO control, and button input concepts through 3 hands-on tasks.
Let's connect this to a real-world scenario
3 tasks: (1) Traffic Light Simulator — wire up 3 LEDs (red, yellow, green) and write a Python script that auto-cycles them through a sequence (red→green→yellow→red); (2) Button-Controlled LED Brightness — use PWM (gpiozero's PWMLED class) to step up the LED's brightness level each time a button is pressed; (3) Reaction Time Game — combine a button press and an LED into a mini-game that measures how long it takes from the LED lighting up to the button being pressed.
Let's walk through it together
# Task 1 starter — traffic light sequence skeleton
from gpiozero import LED
from time import sleep
red, yellow, green = LED(17), LED(27), LED(22)
while True:
red.on(); sleep(3); red.off()
green.on(); sleep(3); green.off()
yellow.on(); sleep(1); yellow.off()You'll finish with a runnable Python script/circuit for all 3 tasks.5-Minute Try-It
Work through the 3 tasks yourself, in order — if you don't have LEDs/wiring resources on hand, just writing out the code logic still counts as learning.
A quick word of caution
Even without a physical LED/circuit yet, write out the code logic yourself — getting comfortable with the logic ahead of time saves you time once you actually have the hardware and just need to handle the wiring.