Daisy chaining 74HC595 shift registers

samwhiteUK:
Right, first things first, if this is in the wrong section, feel free to move it.

Now, onto the question:

I am trying to make sound-reactive LEDs (you may have seen my last post). I have a bar of 8 working fine with one 74HC595. Now I want to try and use 16 LEDs.

I have wired the Q7' pin from the first to the DS pin on the second, and I figured that if I were to write a value bigger than 255 to the first register, then the bits would over flow into the second, e.g. if I were to write 511, all 8 pins would light up on the first register and one on the second. However, they work independently from each other, both doing the same thing, like two bars of 8.

My sketch can be found here: Sound Reactive LEDs - Pastebin.com

Thanks for any help provided,

Sam

There are more than a few good examples for chaining 595. Here is one http://arduino.cc/en/Tutorial/ShftOut13 . You're right about sending 16bits etc. But I would suggest that you first look at the source code for the shiftOut function (very simple code) and try to understand how it's sending the information. But it's like you did in your code. But instead of calling the shiftOut function once, you do it twice. The first shiftOut will go to the chained register(connected to Q7) and the second shiftOut will go to the main register(connected to DS).

BTW, here is the source code for shiftout http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274766175