Friday, January 21, 2011

Project 3 - Traffic Lights

I modifed Project 3 just a bit - first off, the book uses a UK traffic light system so I changed it to the US version (red... green... yellow... red... ) and I changed the LED delay from 10000ms to 5000ms (5 seconds) for faster switching between LEDs (for video purposes).

A couple other notes - in the book, the breadboard seen in Figure 2-6 has the left side power/ground columns shown with Ground (blue line) closer to the center of the board and the High/Pwr (red line) on the left and furthest from the center of the board. This doesn't match my breadboard (no big deal) but if you look at the photo here you'll see that I also had to modify the wiring to reflect that... everything else was the same. (Technically, I guess the column you use really doesn't matter as long as you are consistent, but I've tried to be consistent in using a breadboard by using the red column for V+ and the blue column for GND.)

One simple mistake I made at first was inserting the yellow LED incorrectly... I thought I had placed the anode end of the LED in the same row as the resistor, but when the LEDs didn't light up properly, I pulled out the yellow and found the flat/anode side of the LED inserted incorrectly. At some point I had clipped the wires on the yellow LED to the same length... so always check that and make certain that the flat/notch side of the LED plastic dome is connected to GND or LOW.

One last thing - if you look at my code screen captures, you'll notice that, yes, I'm not typing in the comments. Sorry. I'm not really saving this code in a folder, so I'm not taking the time to enter comments... may do that later when the code gets longer and more complicated.

UPDATE: Original video had sound problems... fixed now.

No comments:

Post a Comment