Arduino LED 3,2,1 Countdown Timer

5,300

4

3

Posted

Introduction: Arduino LED 3,2,1 Countdown Timer

Even though I have been using an arduino for a year and a half or so, I never made an effort to learn the language until now. This is my first project with an arduino that I built and coded all by myself. If anyone is interested, here is the code:

void setup() {
pinMode(2,OUTPUT); //red LED
pinMode(3,OUTPUT); // yellow LED
pinMode(1,OUTPUT); // green LED
pinMode(4,OUTPUT); // "go" sign
}
void loop(){
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
delay(1000);
digitalWrite(3,LOW);
digitalWrite(1,HIGH);
delay(1000);
digitalWrite(1,LOW);
delay(500);
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
delay(500) ;
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
delay(500);
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
delay(500);
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
delay(500);
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
delay(500);
digitalWrite(4,HIGH);
delay(500);
digitalWrite(4,LOW);
}

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    3 Comments

    Pretty cool. It's like a small version of the lights they use at drag races. The arduino got allot more fun once I started programming it myself. Good job.

    Yeah I know what you mean! Thanks!