Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created June 23, 2023 09:38
Show Gist options
  • Save AbhishekGhosh/512c1a9b155ab6e09a26f72835bb9318 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/512c1a9b155ab6e09a26f72835bb9318 to your computer and use it in GitHub Desktop.
Simple LED chaser Arduino
int LED13 = 13;
int LED12 = 12;
int LED11 = 11;
int LED10 = 10;
int LED9 = 9;
int LED8 = 8;
int LED7 = 7;
int LED6 = 6;
int LED5 = 5;
int LED4 = 4;
int LED3 = 3;
int LED2 = 2;
void setup() {
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(LED8, OUTPUT);
pinMode(LED9, OUTPUT);
pinMode(LED10, OUTPUT);
pinMode(LED11, OUTPUT);
pinMode(LED12, OUTPUT);
pinMode(LED13, OUTPUT);
}
void loop() {
digitalWrite(LED2, HIGH);
delay(100);
digitalWrite(LED2, LOW);
delay(100);
digitalWrite(LED3, HIGH);
delay(100);
digitalWrite(LED3, LOW);
delay(100);
digitalWrite(LED4, HIGH);
delay(100);
digitalWrite(LED4, LOW);
delay(100);
digitalWrite(LED5, HIGH);
delay(100);
digitalWrite(LED5, LOW);
delay(100);
digitalWrite(LED6, HIGH);
delay(100);
digitalWrite(LED6, LOW);
delay(100);
digitalWrite(LED7, HIGH);
delay(100);
digitalWrite(LED7, LOW);
delay(100);
digitalWrite(LED8, HIGH);
delay(100);
digitalWrite(LED8, LOW);
delay(100);
digitalWrite(LED9, HIGH);
delay(100);
digitalWrite(LED9, LOW);
delay(100);
digitalWrite(LED10, HIGH);
delay(100);
digitalWrite(LED10, LOW);
delay(100);
digitalWrite(LED11, HIGH);
delay(100);
digitalWrite(LED11, LOW);
delay(100);
digitalWrite(LED12, HIGH);
delay(100);
digitalWrite(LED12, LOW);
delay(100);
digitalWrite(LED13, HIGH);
delay(100);
digitalWrite(LED13, LOW);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment