#define STR A3
#define DATA A2
#define CLK A4

void setup() {
  digitalWrite(CLK,LOW);
  digitalWrite(DATA,LOW);
  digitalWrite(STR,LOW);
  pinMode(STR,OUTPUT);
  pinMode(DATA,OUTPUT);
  pinMode(CLK,OUTPUT); 
}



void shiftOUT(byte n)
{
   byte bitmask=0x80;
   
   while(bitmask)
   {
      
      if(bitmask & n) digitalWrite(DATA,LOW);
        else digitalWrite(DATA,HIGH);
        
      digitalWrite(CLK,HIGH);
      delay(1);
      digitalWrite(CLK,LOW);
      delay(1);
      bitmask>>=1;
   }

   digitalWrite(STR,HIGH);
   delay(1);
   digitalWrite(STR,LOW);
   delay(1);
}

void loop() {
    
     for(int i=0;i<256;i++)
     {
       shiftOUT(i);
       delay(1000);
     }
}
74HC595