8 Relay Board (HL-58S V1.0)

IMG_1331

#define RELAY1  2   //(Digital Pin 2)

#define RELAY2  3

#define RELAY3  4

#define RELAY4  5

#define RELAY5  6

#define RELAY6  7

#define RELAY7  8

#define RELAY8  9  //(Digital Pin 9)

void setup()

{

// Initialise the Arduino data pins for OUTPUT

pinMode(RELAY1, OUTPUT);

pinMode(RELAY2, OUTPUT);

pinMode(RELAY3, OUTPUT);

pinMode(RELAY4, OUTPUT);

pinMode(RELAY5, OUTPUT);

pinMode(RELAY6, OUTPUT);

pinMode(RELAY7, OUTPUT);

pinMode(RELAY8, OUTPUT);

}

void loop()

{

digitalWrite(RELAY1,LOW);           // Turns ON Relays 1

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY1,HIGH);          // Turns Relay Off

digitalWrite(RELAY2,LOW);           // Turns ON Relays 2

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY2,HIGH);          // Turns Relay Off

digitalWrite(RELAY3,LOW);           // Turns ON Relays 3

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY3,HIGH);          // Turns Relay Off

digitalWrite(RELAY4,LOW);           // Turns ON Relays 4

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY4,HIGH);          // Turns Relay Off

digitalWrite(RELAY5,LOW);           // Turns ON Relays 5

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY5,HIGH);          // Turns Relay Off

digitalWrite(RELAY6,LOW);           // Turns ON Relays 6

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY6,HIGH);          // Turns Relay Off

digitalWrite(RELAY7,LOW);           // Turns ON Relays 7

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY7,HIGH);          // Turns Relay Off

digitalWrite(RELAY8,LOW);           // Turns ON Relays 8

delay(1000);                                      // Wait 1 seconds

digitalWrite(RELAY8,HIGH);          // Turns Relay Off
}

Advertisements
This entry was posted in Arduino Project. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s