0% found this document useful (0 votes)
4 views1 page

CH y LED CH

This document contains an Arduino sketch that controls three LEDs connected to digital pins 8, 9, and 10. In the setup function, the pins are initialized as outputs and set to LOW. The loop function sequentially turns each LED on and off with a delay of one second, creating a blinking effect.

Uploaded by

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

CH y LED CH

This document contains an Arduino sketch that controls three LEDs connected to digital pins 8, 9, and 10. In the setup function, the pins are initialized as outputs and set to LOW. The loop function sequentially turns each LED on and off with a delay of one second, creating a blinking effect.

Uploaded by

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

int led1 = 8;

int led2 = 9;
int led3 = 10;

void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(led3, HIGH);
delay(1000);
digitalWrite(led3, LOW);
digitalWrite(led2, HIGH);
delay(1000);
digitalWrite(led2, LOW);
digitalWrite(led1, HIGH);
delay(1000);
digitalWrite(led3, HIGH);
delay(1000);
digitalWrite(led3, LOW);
digitalWrite(led2, HIGH);
delay(1000);
digitalWrite(led3, HIGH);
delay(1000);
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
delay(1000);
;

You might also like