#define RELAY_PIN 16 // ESP32 pin 16 connected to the IN pin of relay
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(9600);
// initialize digital pin as an output.
pinMode(RELAY_PIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
Serial.println("The LED is turned on");
digitalWrite(RELAY_PIN, HIGH);
delay(2000);
Serial.println("The LED is turned off");
digitalWrite(RELAY_PIN, LOW);
delay(2000);
}