I have some confusion about using more than two 74hc595 shift registers. Does anyone have any example code that uses three or more shift registers? If so could you post it here.
Thanks,
Casey.
If they are chained together I think you just need to send 16 clocks rather than 8.
shiftOut(dataPin, clockPin, bitOrder, dataToSendToFirstOne);
shiftOut(dataPin, clockPin, bitOrder, dataToSendToSecondOne);
shiftOut(dataPin, clockPin, bitOrder, dataToSendToThirdOne);
shiftOut(dataPin, clockPin, bitOrder, dataToSendToFourthOne);
//...
digitalWrite(latchPin, HIGH);
digitalWrite(latchPin, LOW);
There is a really good article on bildr.com about using multiple shift registers that helped me out a lot. There is also some additional info on the bildr.com forums.
Okay so say i have an array like so:
int rows[16] = {0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0};
And I have two shift registers chained together. The first 8 numbers in the array need to represent the LED's 1-8 on the first shift register and the last 8 numbers have to represent the LED's 9-16 in the second shift register. So with this array controlling the shift registers outputs, all LED's have to be off except led 13. So what I'm trying to say is if rows[13] = 1, how can I have it turn on just the 13th LED (5th led of the second shift register) with the given array?
sorry if this is very confusing, but thats mostly the reason I am having difficulty.
Thanks,
Casey