esp_arduino_stuff
This commit is contained in:
28
basic_relay_test/basic_relay_test.ino
Normal file
28
basic_relay_test/basic_relay_test.ino
Normal file
@@ -0,0 +1,28 @@
|
||||
/*********
|
||||
Rui Santos
|
||||
Complete project details at https://RandomNerdTutorials.com/esp8266-relay-module-ac-web-server/
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
*********/
|
||||
|
||||
const int relay = 5;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
pinMode(relay, OUTPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Normally Open configuration, send LOW signal to let current flow
|
||||
// (if you're usong Normally Closed configuration send HIGH signal)
|
||||
digitalWrite(relay, LOW);
|
||||
Serial.println("Current Flowing");
|
||||
delay(5000);
|
||||
|
||||
// Normally Open configuration, send HIGH signal stop current flow
|
||||
// (if you're usong Normally Closed configuration send LOW signal)
|
||||
digitalWrite(relay, HIGH);
|
||||
Serial.println("Current not Flowing");
|
||||
delay(5000);
|
||||
}
|
||||
Reference in New Issue
Block a user