0% found this document useful (0 votes)
13 views3 pages

Multiple Led

Uploaded by

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

Multiple Led

Uploaded by

Himanshu Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

/ Define LED pins

const int led1 = 13;

const int led2 = 12;

const int led3 = 11;

const int led4 = 10;

void setup() {

// Set LED pins as outputs

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

pinMode(led3, OUTPUT);

pinMode(led4, OUTPUT);

void loop() {

// Turn OFF LED 2 and off LED 4

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

digitalWrite(led3, HIGH);

digitalWrite(led4, LOW);

delay(1000); // Wait for 1 second

// Turn off LED 1 and on LED 3

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);

digitalWrite(led4, HIGH);

delay(1000); // Wait for 1 second

}
2 LED Blink
// Define LED pins

const int led1 = 13;

const int led2 = 10;

void setup() {

// Set LED pins as outputs

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

void loop() {

// Turn on LED 1 and off LED 2

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

delay(1000); // Wait for 1 second

// Turn off LED 1 and on LED 2

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

delay(1000); // Wait for 1 second

You might also like