
Arduino Drag Racing Tree – Simple code using delay
Arduino Drag Racing Tree – Simple code using delay.
// Drag Racing Tree by MagDragster.com
// Simple tree layout using the DELAY function.
//
//
//
//
//
int TopYellowBulbs = 13;
int MiddleYellowBulbs = 12;
int BottomYellowBulbs = 11;
int GreenBulb = 10;
void setup()
{
pinMode(TopYellowBulbs, OUTPUT); // sets the digital pin 13 as output
pinMode(MiddleYellowBulbs, OUTPUT);
pinMode(BottomYellowBulbs, OUTPUT);
pinMode(GreenBulb, OUTPUT); // sets the digital pin 13 as output
}
void loop()
{
digitalWrite(13, HIGH); // Turns the LED on pin 13 on
delay(300);
digitalWrite(12, HIGH); // Turns the LED on pin 12 on
delay(300);
digitalWrite(11, HIGH); // Turns the LED on pin 11 on
delay(300);
digitalWrite(10, HIGH); // Turns the green LEDs on pin 10 on
delay(300);
digitalWrite(13, LOW);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(10, LOW);
delay(100);
// Exit the loop
exit(0); //The 0 is required to prevent compile error.
}
(137)
Related posts:
No related posts.