4
Connection
Connection
#define RELAY1 13
#define RELAY2 12
#define RELAY3 11
#define RELAY4 10
void setup()
{
// Initialize the arduino data pins for OUTPUT
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
}
void loop()
{
digitalWrite(RELAY1, HIGH); // Turns ON Relay 1
delay(2000); // Wait 2 seconds
digitalWrite(RELAY1, LOW); // Turns OFF Relay 1
digitalWrite(RELAY2, HIGH); // Turns ON Relay 2
delay(2000); // Wait 2 seconds