Why does it skip the first index - shift register issue
The correct way to loop through an array of length 8 is:



for (int counter = 0; counter &lt; 8; ++counter) {
    digitalWrite(2, ledValue[counter]);
    // ...
}


If you want to loop through the array backwards, then:

for (int counter = 7; counter &gt;= 0; --counter) {
    digitalWrite(2, ledValue[counter]);
    // ...
}


This loop will visit, in this order, the indices 7, 6, 5... 1 and 0.

For extra clarity, you could define a constant that holds the length of
the array, then replace the numbers 8 and 7 above by VALUES_COUNT
and VALUES_COUNT-1 respectively.

You wrote:


  If I make it [...] my output is [...]


Not sure what you mean by that. This code should not have much visible
output, as the LEDs are turned off only microseconds after being turned
on. How do you determine what the program's "output" is? Maybe there is
an issue with the way you are trying to diagnose the problem.