Today (well, yesterday at the time of this writeup) my Arduino kit arrived. And according to the writing on the board, the tell-tale golden voltage regulator and the position of the reset button it is a bonafide real made-in-italy Arduino Uno R3, not a chinese knockoff. Despite the kit being from, exactly, China. I had real fun for five seconds trying to decipher the part list, but my knowledge of chinese is a bit too non-existant for that.

However, after verifying the functionality of the board (by blinking the LED) I started my first project: a traffic light, with a button for the pedestrians. Since I’m a lazy bastard I based my project off some other person’s work, in this case the one at the arduinodiy blog (seems like that blog was quite short-lived and died a horrible death by football and a broken hand just three months later, so that link is dead as a doornail. But I digress).

I snatched the code and pasted it into the Arduino editor, but the traffic lights themselves I built without looking at his drawing. Which is the reason I had to change pin numbers first. I had to fiddle a bit with the button, I knew I had to have some pull up or down resistor there, but which and how… that required a bit more thinking than the resistor-LED-chains for the lights themselves.

The next thing I didn’t like with this implementation was the software - rewrite time! For starters: I grew up in Germany, there the traffic lights (with yellow lights, for cars) switch to a red-yellow combo before going to green. Sort of a psychological “it’s still red, but get ready to go”. Piece of cake, just switch the yellow light on first, then wait a second.

But wait, major flaw in the program. Why do I myself have to wait for the minimum green phase for the cars before I can press the pedestrian button? That makes no sense! So the next modification is one that doesn’t check the state of the button and the minimum green phase in one if-statement, but just checks the button, and delays the reaction if the minimum green phase hasn’t passed yet. Neato!

Ok, so there’s still a little flaw in that you can’t press the button the second your pedestrian light goes red (because you have to wait for the car light to go green, which after my first modification is even a second later than the original design). But for now I’m pleased, and simple as it may be - it worked!

Pictures, code and maybe a small movie coming later. Although, since I wrote this more than seven years ago at the time I revise this article for my new website, don’t hold your breath…