Arduino LED 3,2,1 Countdown Timer

About: I love making things. I always found electronics and stuff like that fun. When I was little I always took apart my toys and put them back together. I thank God for giving me my gift of my creativity and know...

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

    • PCB Contest

      PCB Contest
    • First Time Author

      First Time Author
    • Toys Contest

      Toys Contest

    3 Discussions

    0
    None
    Reffner

    7 years ago on Introduction

    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.

    1 reply