// by NMDWeerasinghe @COTMD 
// Using Seperate Clock lines and common Latch and common data lines

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 */ //Seperate clock pin
//const int latchPin2 = 7;  /* STCP */

int pattern1;
int pattern2;

void setup() {
  for(int i = 2; i<8; i++)
   {
      pinMode(i, OUTPUT);
   }

 pattern1 = 0b10111110;//1
 pattern2 = 0b11110110;//9

  digitalWrite(latchPin1, LOW);
  shiftOut(dataPin1, clockPin1, LSBFIRST, pattern1);
  digitalWrite(latchPin1, HIGH);
  delay(10);
  digitalWrite(latchPin1, LOW);
  shiftOut(dataPin1, clockPin2, LSBFIRST, pattern2);
  digitalWrite(latchPin1, HIGH);
  delay(1500);
  digitalWrite(latchPin1, LOW);
  shiftOut(dataPin1, clockPin1, LSBFIRST, 0b01100110);
  digitalWrite(latchPin1, HIGH);
  delay(1500);
  digitalWrite(latchPin1, LOW);
  shiftOut(dataPin1, clockPin2, LSBFIRST, 0b11100000);
  digitalWrite(latchPin1, HIGH);
  delay(10);

}


void loop() {
  
  //pattern = ~pattern; // Invert the pattern
}
74HC595
74HC595