Led Pattern Video & Code

Led Pattern Video

 

/* A simple program to sequentially turn on and turn off 3 LEDs */
//https://www.youtube.com/watch?v=e1FVSpkw6q4
//edited by Kelsey McShane
int LED1 = 11;
int LED2 = 3;
int LED3 = 13;
int LED4 = 12;
int LED5 = 4;
int LED6 = 2;

void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
}

 

void loop() {
digitalWrite(LED1, HIGH); // turn on LED1
delay(100);
digitalWrite(LED2, HIGH); // turn on LED2
delay(100);
digitalWrite(LED3, HIGH); // turn on LED3
delay(100);
digitalWrite(LED4, HIGH); // turn on LED4
delay(100);
digitalWrite(LED5, HIGH); // turn on LED5
delay(100);
digitalWrite(LED6, HIGH); // turn on LED6
delay(100);
digitalWrite(LED1, LOW); // turn off LED1
delay(100);
digitalWrite(LED2, LOW); // turn off LED2
delay(200);
digitalWrite(LED3, LOW); // turn off LED3
delay(200);
digitalWrite(LED4, LOW); // turn off LED4
delay(200);
digitalWrite(LED5, LOW); // turn off LED5
delay(200);
digitalWrite(LED6, LOW); // turn off LED6
delay(200);
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s