Skip to content

Instantly share code, notes, and snippets.

@techzeero
Last active October 21, 2019 10:02
Show Gist options
  • Save techzeero/1c5f5b7cbe4c1380f65e49cc26c00f2e to your computer and use it in GitHub Desktop.
Save techzeero/1c5f5b7cbe4c1380f65e49cc26c00f2e to your computer and use it in GitHub Desktop.
/*
Controlling Multiple LEDs With an Arduino
For more details, visit: https://techzeero.com/arduino-tutorials/multiple-leds-blinking-using-arduino/
*/
void setup()
{
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
}
void loop()
{
digitalWrite(7, HIGH);
digitalWrite(6, HIGH);
digitalWrite(5, HIGH);
digitalWrite(4, HIGH);
digitalWrite(3, HIGH);
delay(200); // Wait for 200 millisecond(s)
digitalWrite(7, LOW);
delay(200); // Wait for 200 millisecond(s)
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
delay(200); // Wait for 200 millisecond(s)
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
delay(200); // Wait for 200 millisecond(s)
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(200); // Wait for 200 millisecond(s)
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(200); // Wait for 200 millisecond(s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment