I've uploaded another long how-to blog post. This time I've cascaded four 74HC595 shift registers to drive 4 7-segment displays from only 3 Arduino lines. I also added code to take the number to display from serial port input.
My blog post has instructions, a full schematic of the circuit, some photos, and a YouTube video link. Check it out here.
Hopefully someone finds this interesting/useful - hard to tell with no feedback.
The main display of all the weather data is to be my PC.
The PC is on only for short periods so for most of the time
the arduino will just be a box with blinking lights.
I did not have many digital pins left but with your circuit I
think I will add some hex display to make it more entertaining.
I may write it as a small class as I did for the sd card:
@nouse4anick No - this is called showing people how to do it the easy way first - building blocks - then going to more advanced stuff with only a couple of shift registers and a bunch of 3-8 line decoders to cut down on component count and increase effective fanout. No point showing people how to run before walking. But thanks for your comment.
I wouldn't really call it 'doing it the easy way'... more of a brute force method of doing it.
The next project you might want to consider using 4094's and some bcd to 7 seg decoders, it makes for much cleaner code (i posted an example a while ago).
The other thing I like is that without using the 8th output on each shift register (if I don't care about the decimal points on the 7-segs), I've now got an extra output per 595 to use for something else if I want.
while you would have to use a couple extra chips, you remove a LOT of code and overhead to any project by reducing the amount of work for each iteration of the program.
for example: your method requires extra memory to map the outputs correctly, if you use BCD then you don't really require any extra arrays or complicated if statements (my algorithm for 2 digits was only a dozen lines or so).
I'm not just building these circuits to just drive 7-seg displays. My blog series is building up the knowledge, code, and circuitry to be able to drive arrays of 8x8 LED matrices and into double-digit-n nxnxn LED cubes. This blog post was about how to daisy-chain shift registers, not about the most compact, code-tight way to drive 2 x 7-seg displays.
I completely understand what you're saying - but for pure 7-seg display driving, you're doing it a different way from me - extra h/w vs. extra code. There's no saying one way is better than the other - the solutions have different characteristics.
So i'm in this design project class where were using the arduino to take in MIDI input (wait for it, there's a point that's relevant to this post) from a MIDI piano, and use it to signal solenoids that will play something. The trouble is, its hard to tell what bytes are being placed inside the arduino's serial buffer for debugging purposes, but I figured from what I read here that with three 2 digit 7-segment displays, and a bunch of shift registers, i can make a midi serial analyzer of sorts, right? Thanks.