As part of my pinball project, I’d like to be able to display the user’s score on a few 7-segment LEDs. Unless I want to use every pin on my Arduino to control two numbers, I needed to learn how to use a shift-register to store my LED values and display them. Because the 74HC595 can be daisy-chained together, I can use the same code to write to six numbers just as easily as I write to one.
The code for this project, and the layout of the LEDs was taken from an excellent post on Bildr called Can You Move Over?
I adapted their code to light up all of the LEDS but one, and shift this pattern to the left every 500 milliseconds. The result is this video here:
I had planed to use the 7-segment display I bought over the weekend, but in attempting to wire up the display, I learned an important lesson in the difference between common cathode LEDs and common anode.
Knowing that earlier would have saved me a dollar, but at least I know now for the future. And knowing is half the battle.
NIGHTNIGHT by DEDDY