Arduino Traffic Light Example

So here is an example I wrote for some students.  This simulates traffic lights with one arduino for each direction and uses a random timer to decide which device turns green first - then the devices control each other (each can have different times but the code is the same on both devices.


First play with an Arduino Uno and an HC-SR04 Ultrasonic Distance Module

Well, I caved.  I've avoided the mass stampede to the Ardiono camp for a long time, because PICs did everything I wanted and I liked them... but I got offered one of these fandangled Uno things to play with - and I've gotta say its actually pretty neat.  

I can really see why they have taken off, given the ease of programming them (although I suspect that some of the 'glossing over' that the Arduino IDE provides will actually create a whole generation of bad embedded programmers - it really lets you get away with murder compared to a standard C implementation).