Traffic Lights Demo for Raspberry Pi GPIO
Built on Raspbian (Raspberry Pi reference 2013-05-25 (armhf)) with the standard Python and modules.
Uses the PINs 7 (GPIO 4), 11 (GPIO 17) and 15 (GPIO 22) hooked up to red, yellow and green LEDs respectively via 280 Ohm resistors.
Follows the UK convention of traffic lights performing the following sequence:
- Red (stop at the line)
- Red and amber (get ready to go)
- Green (go go go)
- Amber (stop when possible)
- Red (stop)
Randomised times on green and red, loop the sequence thrice.
Very hacky, should modularise each step...
Should consider the time waiting on red+amber and amber, there may be a standard?