Blink both the relay and LED
This commit is contained in:
parent
35e97572d9
commit
776e73b258
1 changed files with 13 additions and 2 deletions
15
src/main.cpp
15
src/main.cpp
|
@ -1,8 +1,19 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
void setup() { Serial.begin(9600); }
|
#define RELAY 2 // GPIO4
|
||||||
|
#define LED 5 // GPIO5
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
pinMode(LED, OUTPUT);
|
||||||
|
pinMode(RELAY, OUTPUT);
|
||||||
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Serial.println("Hello world!");
|
digitalWrite(LED, HIGH);
|
||||||
|
digitalWrite(RELAY, HIGH);
|
||||||
|
delay(1000);
|
||||||
|
digitalWrite(LED, LOW);
|
||||||
|
digitalWrite(RELAY, LOW);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue