I just got my Arduino and have almost no experience with it. I bought a beginners book with some C coding basics and several Arduino projects to get started. I am in my fifth project (a set of 10 LED's that turn on and off in a sequence) and, for the first time, I am getting a compiling code error that I cannot figure out how to solve. This is my code:
//proyect 5 - LED Chase Effect
byte ledPin[] = {4,5,6,7,8,9,10,11,12,13};
//create array for LED pins
int ledDelay(65);
//delay between changes
int direction = 1;
int currentLED = 0;
unsigned long changeTime;
void setup() {
for (int x=0; x<10; x++)
{ //set all pins to output
pinMode(ledPin[ x ]. OUTPUT);
}
changeTime = millis();
}
void loop(){
if((millis() - changeTime) > ledDelay) {
//if it has been ledDelay ms since last change
changeLED();
changeTime = millis();
}
}
void changeLED(){
for (int x=0; x<10; x++)
{ //turn off all LED's
digitalWrite(ledPin[ x ], LOW);
}
digitalWrite(ledPin[currentLED], HIGH);
//turn on the current LED
currentLED += direction;
//increment by the direction value
//change direction if we reach end
if (currentLED == 9)
{direction = -1;}
if (currentLED == 0)
{direction = 1;}
}
And this is the error that I get:
exit status 1
Error compiling for board Arduino/Genuino Uno.
How can I solve this?
Thanks for the help!