0% found this document useful (0 votes)
7 views2 pages

Relay

The document contains two Arduino sketches that control an output pin to turn a relay on and off. In both sketches, pin 11 and pin 3 are set as outputs and toggled every second. Each sketch includes a setup function for initialization and a loop function for continuous operation.

Uploaded by

aimadityaraj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Relay

The document contains two Arduino sketches that control an output pin to turn a relay on and off. In both sketches, pin 11 and pin 3 are set as outputs and toggled every second. Each sketch includes a setup function for initialization and a loop function for continuous operation.

Uploaded by

aimadityaraj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

void setup()

pinMode(11, OUTPUT);

void loop()

digitalWrite(11, 1);

delay(1000); // Wait for 1000 millisecond(s)

digitalWrite(11, 0);

delay(1000); // Wait for 1000 millisecond(s)

}
// C++ code

//

int relay=3;

void setup()

pinMode(3, OUTPUT);

void loop()

digitalWrite(3, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

digitalWrite(3, LOW);

delay(1000); // Wait for 1000 millisecond(s)

You might also like