Grumpy_Mike:
Wire the output enable pin to ground.As the setup function contains all the code for outputting the data to the shift register it needs moving into the loop function.
Then add at the start of the loop function the lines:-led[0] ^= 1; // this will blink LED 0
delay(300); // so you can see it.
it blinks only first led but my requirement is flashing of whole pattern {0,1,1,0,0,1,1,0}.
int latchPin = 5;
int ClockPin = 6;
int dataPin = 4;
int led[8] = {0,1,1,0,0,1,1,0};
void setup()
{
pinMode(latchPin,OUTPUT);
pinMode(ClockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
led[0] ^= 1; // this will blink LED 0
delay(300); // so you can see it.
digitalWrite(latchPin, LOW);
for(int i=0;i<8;i++)
{
digitalWrite(ClockPin,LOW);
digitalWrite(dataPin,led*);*
-
digitalWrite(ClockPin,HIGH);*
-
} *
-
digitalWrite(latchPin, HIGH); *
}