const int dataPin1 = 2; /* DS */
const int clockPin1 = 3; /* SHCP */
const int latchPin1 = 4; /* STCP */
const int dataPin2 = 5; /* DS */
const int clockPin2 = 6; /* SHCP */
const int latchPin2 = 7; /* STCP */
int pattern1;
int pattern2;
void setup() {
for(int i = 2; i<8; i++)
{
pinMode(i, OUTPUT);
}
pattern1 = 0b01100000;
pattern2 = 0b11111100;
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, pattern1);
digitalWrite(latchPin1, HIGH);
delay(1500);
digitalWrite(latchPin2, LOW);
shiftOut(dataPin2, clockPin2, LSBFIRST, pattern2);
digitalWrite(latchPin2, HIGH);
delay(1500);
digitalWrite(latchPin1, LOW);
shiftOut(dataPin1, clockPin1, LSBFIRST, pattern2);
digitalWrite(latchPin1, HIGH);
delay(1500);
digitalWrite(latchPin2, LOW);
shiftOut(dataPin2, clockPin2, LSBFIRST, pattern1);
digitalWrite(latchPin2, HIGH);
}
void loop() {
//pattern = ~pattern; // Invert the pattern
}