Interactive traffic lights with pygame-zero and gpiozero
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
trafficlights.png
trafficlights.py
trafficlights2.py

README.md

pgz-traffic-lights

Interactive traffic lights with pygame-zero and gpiozero

Traffic Lights

Usage

  • Clone this repo: git clone https://github.com/bennuttall/pgz-traffic-lights
  • Enter the directory: cd pgz-traffic-lights
  • Change the line lights = TrafficLights(2, 3, 4) to match your traffic light pin numbers (red, amber green)
  • Run with pgzrun trafficlights.py
  • Click a colour to light an LED

Also see trafficlights2.py which is a variation in code achieving the same result.

Reference