Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 634 Bytes

README.md

File metadata and controls

20 lines (13 loc) · 634 Bytes

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