#define Relay_Pin 2
void setup() {
// Set the relay pin as an OUTPUT
pinMode(Relay_Pin, OUTPUT);
// Start serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Turn on the relay (LED) for 2 seconds
digitalWrite(Relay_Pin, HIGH);
Serial.println("Relay ON");
delay(2000);
// Turn off the relay (LED) for 2 seconds
digitalWrite(Relay_Pin, LOW);
Serial.println("Relay OFF");
delay(2000);
}