Is there a command that will let me set all 8 output pins of a 595 to LOW without affecting the three other 595s I have chained together?
I'm using this conditional to check if the signal is in the same bank:
if((i % 8) == (pinNumber % 8))
And then if the condition is true, I need to set those pins LOW...
Here is my function for the shiftOut:
void registerWrite(int whichPin, int whichState) {
// the bits you want to send
static int bitsToSend = 0;
static int bitsToSend2 = 0;
// turn off the output so the pins don't light up
// while you're shifting bits:
digitalWrite(latchPin, LOW);
//CHoose which shift register to send to.
if (whichPin <=15){
bitWrite(bitsToSend, whichPin, whichState);
} else {
bitWrite(bitsToSend2, whichPin - 16, whichState);
}
// shift the bytes out:
shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend2 >> 8);
shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend2 & 0xff);
shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend >> 8);
shiftOut(dataPin, clockPin, MSBFIRST, bitsToSend & 0xff);
// turn on the output so the LEDs can light up:
digitalWrite(latchPin, HIGH);
}