Thanks Grumpy_Mike for your cooperation. Only last time please check the code. placement of your code.
int latchPin = 5;
int ClockPin = 6;
int dataPin = 4;
int led[] = {0,1,1,0,0,1,1,0};
int ledState[] = {0,1,1,0,0,1,1,0};
void setup()
{
pinMode(latchPin,OUTPUT);
pinMode(ClockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
digitalWrite(latchPin, LOW);
for(int i=0;i<8;i++)
{
if(led[i] == 1) ledState[i] ^= 1;
digitalWrite(ClockPin,LOW);
digitalWrite(dataPin,ledState[i]);
digitalWrite(ClockPin,HIGH);
}
digitalWrite(latchPin, HIGH);
delay(300);
}
I get the error in ledState line when i am using the following declaration
int led[] = {0,1,1,0,0,1,1,0};
int ledState[] == {0,1,1,0,0,1,1,0};
Last thing i didn't understand following statements.
" Well it is OK but it is not what I told you to do in any of my answers. I told you to insert the code I gave you at the start of the loop function. What you have done is to insert part of the code at the start, miss out some you your original and another part of the code at the end. While by luck it still functions it is not what I told you to do.
The code I gave you should be placed complete and as a whole after the first { in the loop function and before any code you originally had in the loop function. "