Created
October 13, 2016 06:47
-
-
Save abhikpal/03f6827290fcb63e49db67d64d5096f9 to your computer and use it in GitHub Desktop.
This file contains 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
const int num_relays = 8; | |
const int relays[] = {2, 3, 4, 5, 6, 7, 8, 9}; | |
const int duration = 1000; | |
void setup() { | |
for (int i = 0; i < num_relays; i++) { | |
pinMode(relays[i], OUTPUT); | |
digitalWrite(relays[i], HIGH); | |
} | |
} | |
void loop() { | |
for (int i = 0; i < num_relays; i++) { | |
digitalWrite(relays[i], HIGH); | |
delay(duration); | |
digitalWrite(relays[i], LOW); | |
delay(duration); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment