I'm a beginner and don't have much "know-how" in programming. I tried to compile this code and load it onto my board, but received this error message which I didn't understand. The error is: initializer fails to determine size of 'ledPins'. It highlights the first line of the code. Any solutions? I don't know what it means by the "size" of the pins.
int ledPins[] = (2,3,4,5,6,7,8,9);
void setup()
{
int index;
for(index = 0; index <= 7; index++)
{
pinMode(ledPins[index], OUTPUT);
}
}
void loop()
{
int index;
int delayTime = 2000;
for(index = 0; index <= 7; index++)
{
digitalWrite(ledPins[index], HIGH);
delay(delayTime);
}
for(index = 7; index >= 0; index--)
{
digitalWrite(ledPins[index], LOW);
delay(delayTime);
}
}