Skip to content

Instantly share code, notes, and snippets.

@srmq
Created January 18, 2020 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srmq/93b45a1501a9efa2af2d266ec36931e3 to your computer and use it in GitHub Desktop.
Save srmq/93b45a1501a9efa2af2d266ec36931e3 to your computer and use it in GitHub Desktop.
/*
Blinking LEDs
Turns some LEDs on for one second, then off for one second, repeatedly.
This example code is in the public domain.
Inspired by
http://www.arduino.cc/en/Tutorial/Blink
*/
#define IC2 0
#define IC4 2
#define IC5 3
#define IC12 6
#define IC14 8
const int pins[] = {IC2, IC4, IC5, IC12, IC14};
const int nPins = sizeof(pins)/sizeof(int);
// the setup function runs once when you press reset or power the board
void setup() {
for (int i = 0; i < nPins; i++) {
pinMode(pins[i], OUTPUT);
}
}
// the loop function runs over and over again forever
void loop() {
for (int i = 0; i < nPins; i++) {
digitalWrite(pins[i], HIGH); // turn the LED on (HIGH is the voltage level)
}
delay(1000); // wait for a second
for (int i = 0; i < nPins; i++) {
digitalWrite(pins[i], LOW); // turn the LED on (HIGH is the voltage level)
}
delay(1000); // wait for a second
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment