Troubleshooting Dim LED

I'm working on this project where I have correctly wire 9 LEDs to the arduino and make certain LEDs flash so that it corresponds to a song.

My problem is that when I edit the code to turn on/off certain LEDs they all work perfectly fine, except for port 10 which instead of blinking bright like the rest of them blinks very very dim.

I have tried everything to fix this

-change LED
-change resistor/wires/arduino/breadboard/computer

Code:

int ledPins[] = {2,3,4,5,6,7,8,9,10};

void setup()
{
int index;

for(index = 0; index <= 7; index++)
{
pinMode(ledPins[index],OUTPUT);

}
}

void loop()
{
digitalWrite(ledPins[8], HIGH);
delay(500);
digitalWrite(ledPins [8], LOW);
delay(500);
}

If anyone could help me get my light bright again, please let me know

Thanks in advance

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:

[code]

[color=blue]// your code is here[/color]

[/code]

Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool but it's still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason or random blank lines just make for more scrolling when we're trying to read your code. Do not post double spaced code.

OK, so you have 9 pins in the array:

greg81200:

int ledPins[] = {2,3,4,5,6,7,8,9,10};

then you only set the first 8 pins to OUTPUT:

greg81200:
for(index = 0; index <= 7; index++)
{
pinMode(ledPins[index],OUTPUT);

}

greg81200:

 digitalWrite(ledPins[8], HIGH);  

delay(500);
 digitalWrite(ledPins [8], LOW);
 delay(500);

Since the 9th item in the array wasn't set to ouput, you are turning the internal pull-up resistor on and off with the above code rather than setting the pin HIGH and LOW as you expected, thus the dim LED.

Here's how you can make your for loop automatically handle any number of items in the array:

for(index = 0; index < sizeof(ledPins) / sizeof(ledPins[0]); index++)

Thanks so much for the help, this worked!

I was also able to finish my project, if anyone wants to see it the link is: