Tuesday, January 28, 2014
Raspberry Pi: Python Traffic Light Program
Here is a very simple Python program to demonstrate the "Push your Pi ! 8 LED & 8 Button breakout board for your Raspberry Pi GPIO" from http://mypishop.com/ (I wrote about this board in an earlier post).
It used the left 3 leds for one signal light, and the right 3 leds for the other one. I know that the lights are all red rather than red/yellow/green, you have to use your imagination :-)
The program is very trivial, but hopefully easy to understand for a newbie.
Make sure that you install the required RPIO package as described in another post.
Next step would be to use two of the push buttons to indicate traffic in the left turn lane and trigger a flashing advanced green.
Eric Pierce VA3EP - See the Disclaimer in the Introduction
© Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", 1952-2099. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Eric Pierce and "VA3EP Amateur Radio And Other Geek Pursuits", with appropriate and specific direction to the original content.