Test control of a 7-segment display via a 74HC595 shift register.
Here’s a quick video of the circuit in action:
While you can wire up each segment pin to a digital out on the Arduino as in the LED7Segment/DirectDrive project, it soon becomes pretty wasteful of pins. This project uses a 74HC595 8-bit shift register to feed segment values, requiring only 3 pins.
Since the 74HC595 has latched outputs, it also means all segment changes are simulataneous.
Here’s a summary of how the bits in the shift register are mapped to LED segments:
|0||A - top horizontal|
|1||B - top right vertical|
|2||C - bottom right vertical|
|3||D - bottom horizontal|
|4||E - bottom left vertical|
|5||F - top left vertical|
|6||G - center horizontal|
|7||dp - decimal point|
However the code uses bytes to represent dp,G,F..A from MSB to LSB, so I use MSBFIRST transfer.