Created
April 26, 2015 11:31
-
-
Save tmhrtwg/62248abb16ad26dcbffd 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
/* ********************************************** | |
Project 1b: relay switch | |
The idea is to see if I can control the | |
relay switch I bought. | |
********************************************** */ | |
int relay1 = 11; | |
int relay2 = 10; | |
int relay3 = 9; | |
int relay4 = 8; | |
void setup() { | |
// debug | |
// Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results. | |
// Set relay pins to output | |
pinMode(relay1, OUTPUT); | |
pinMode(relay2, OUTPUT); | |
pinMode(relay3, OUTPUT); | |
pinMode(relay4, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(relay1, HIGH); | |
delay(200); | |
digitalWrite(relay2, HIGH); | |
delay(200); | |
digitalWrite(relay3, HIGH); | |
delay(200); | |
digitalWrite(relay4, HIGH); | |
delay(3000); | |
digitalWrite(relay1, LOW); | |
digitalWrite(relay2, LOW); | |
digitalWrite(relay3, LOW); | |
digitalWrite(relay4, LOW); | |
delay(3000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment