Go Down

Topic: ChangeLights function doesn`t work on my Arduino IDE (Read 296 times) previous topic - next topic

Cha_L

Hey everyone !
I am new to the Arduino projects and enjoying it !

I wanted to make the traffic light tutorial (found here ) the problem is the 'changeLights' function doesn't work, I mean it is not included in any Libraries on my arduino IDE... It's juste like the function won't work.
I've been looking on internet for the same situation than me but I couldn't find any help, or anyone that have the same issue so I know I definitely did something wrong but I don't know what....

Thanks in advance for your help !
Cha

UKHeliBob

Quote
the problem is the 'changeLights' function doesn't work, I mean it is not included in any Libraries on my arduino IDE... It's juste like the function won't work.
Do you mean this changeLights() function which is on the page you linked to
Code: [Select]

void changeLights(){
    // green off, yellow on for 3 seconds
    digitalWrite(green, LOW);
    digitalWrite(yellow, HIGH);
    delay(3000);

    // turn off yellow, then turn red on for 5 seconds
    digitalWrite(yellow, LOW);
    digitalWrite(red, HIGH);
    delay(5000);

    // red and yellow on for 2 seconds (red is already on though)
    digitalWrite(yellow, HIGH);
    delay(2000);

    // turn off red and yellow, then turn on green
    digitalWrite(yellow, LOW);
    digitalWrite(red, LOW);
    digitalWrite(green, HIGH);
    delay(3000);
}

What happens when you run the program ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up