Created
January 18, 2020 13:57
-
-
Save srmq/93b45a1501a9efa2af2d266ec36931e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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