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

Diagrmadluz 011615

The document declares variables for LEDs and a buzzer, configures their pins as outputs, then turns on LEDs and the buzzer in a repeating pattern using a for loop. It initializes the LEDs and buzzer to off, turns one LED on, then loops through turning other LEDs and the buzzer on and off in sequence with delays before finishing.

Uploaded by

220543
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)
12 views1 page

Diagrmadluz 011615

The document declares variables for LEDs and a buzzer, configures their pins as outputs, then turns on LEDs and the buzzer in a repeating pattern using a for loop. It initializes the LEDs and buzzer to off, turns one LED on, then loops through turning other LEDs and the buzzer on and off in sequence with delays before finishing.

Uploaded by

220543
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/ 1

INICIO 1.

INICI0
2. DECLARAR VARIABLES:
Declarar variables: int ledV=3;
int ledA=5;
int ledV=3;
int ledR=6;
int ledA=5; int buzzer=9;
int ledR=6; 3. CONFIGURAR ENTRADAS Y SALIDAS:
PinMode (ledV, OUTPUT);
int buzzer=9;
PinMode (ledA, OUTPUT);
PinMode (ledR, OUTPUT);
configurar entradas y salidas:
PinMode (buzzer, OUTPUT);
PinMode (ledV, OUTPUT); 4. DECLARAR UNA VARIABLE
PinMode (ledA, OUTPUT); GUARDADA PARA CADA UNA DE LAS
PinMode (ledR, OUTPUT);
ENTRADAS:
digitalWrite (ledA, LOW);
PinMode (buzzer, OUTPUT); digitalWrite (ledR, LOW);
digitalWrite (buzzer, LOW);
Declarar una variable guardada para cada
una de las entradas: digitalWrite (ledV, HIGH);
delay (2000);
digitalWrite (ledA, LOW);
5. APLICAR CICLO FOR:
digitalWrite (ledR, LOW); For (int i=0; i<5; i++)
digitalWrite (buzzer, LOW); digitalWrite (ledV, LOW);
digitalWrite (ledR, LOW);
digitalWrite (ledV, HIGH);
digitalWrite (buzzer, LOW);
delay (2000); digitalWrite (ledA, HIGH);
delay (250);
Aplicar ciclo FOR: digitalWrite (ledV, LOW);
For (int i=0; i<5; i++)
digitalWrite (ledR, LOW);
digitalWrite (ledA, LOW);
digitalWrite (ledV, LOW); digitalWrite (buzzer, LOW);
digitalWrite (ledR, LOW); delay (250);
digitalWrite (ledA, LOW);
digitalWrite (buzzer, LOW);
digitalWrite (ledV, LOW);
digitalWrite (ledA, HIGH); digitalWrite (ledR, HIGH);
delay (250);
digitalWrite (buzzer, HIGH);
delay (2000);
digitalWrite (ledV, LOW); 6. FIN
digitalWrite (ledR, LOW);

digitalWrite (ledA, LOW);

digitalWrite (buzzer, LOW);

delay (250);

digitalWrite (ledA, LOW);

digitalWrite (ledV, LOW);

digitalWrite (ledR, HIGH);

digitalWrite (buzzer, HIGH);

delay (2000);

FIN

You might also like