i am learning so i do not have enough skill to understand. i hope you understand. i am beginner.
Yes I understand, that is what I am trying to teach you, the relationship between what someone tells you to do and the code you write.
But still please check once that position of variable,loop etc are ok.
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.
The same goes for the code in reply #5. This code uses a new, extra array called ledState. it is used to hold the current state ( that is on or off ) of your LEDs. It must be declared exactly like you declare the array led, at the start of the code, I would suggest in the line below the led array declaration.
So like this:-
int led[] = {0,1,1,0,0,1,1,0};
int ledState[] = {0,1,1,0,0,1,1,0};