Add relay driver example sketch
This commit is contained in:
parent
0755bcfe40
commit
1833ecf607
24
firmware/relays/relays.ino
Normal file
24
firmware/relays/relays.ino
Normal 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);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user