The Arduino is a microcontroller board and associated peripherals which offers an inexpensive way to build interactive projects such as remote controlled robots, GPS tracking systems, and interactive games.
I have a strong background in computer software, having made my living as a computer programmer. I approached the Arduino as a way to extend my skills into hardware.
An excellent book for getting introduced to the Arduino is “Arduino Workshop, second edition : a Hands-on Introduction with 65 Projects” by John Boxall from No Starch Press, ISBN 978-1-7185-0058-7. I enjoyed building the circuit for Project #5, Controlling Traffic, but I found the software too simple for my taste. I spent two days designing and writing better software, and two weeks debugging it. My new “sketch” for project #5 provides much better traffic flow than the software in the book.
I offer my software here under a liberal license in the hope of demonstrating to readers of “Arduino Workshop” modern real-time software techniques.
You can download the software from this URL: traffic_signal.ino.