Add relay driver example sketch

This commit is contained in:
Tanner Collin 2022-09-18 15:30:42 -06:00
parent 0755bcfe40
commit 1833ecf607

View File

@ -0,0 +1,24 @@
#define RELAY1_PIN 11
#define RELAY2_PIN 7
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(RELAY1_PIN, OUTPUT);
pinMode(RELAY2_PIN, OUTPUT);
digitalWrite(RELAY1_PIN, LOW);
digitalWrite(RELAY2_PIN, LOW);
}
void loop() {
digitalWrite(RELAY1_PIN, HIGH);
delay(500);
digitalWrite(RELAY2_PIN, HIGH);
delay(500);
digitalWrite(RELAY1_PIN, LOW);
delay(500);
digitalWrite(RELAY2_PIN, LOW);
delay(500);
}