const int relayPin = 4; // Define pins
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
}
void loop() {
// Turn on the relay for 2 seconds
digitalWrite(relayPin, HIGH);
delay(2000);
// Turn off the relay for 2 seconds
digitalWrite(relayPin, LOW);
delay(2000);
}