0% found this document useful (0 votes)
71 views8 pages

Proyecto de Arduino "Calle de Luz": Integrantes: - Jeny Vanessa López Díaz - Valentina Guzmán Porras

This document describes an Arduino project called "Street of Light" created by Jeny Vanessa López Díaz and Valentina Guzmán Porras. It includes a pictorial diagram and code to control different lights and sensors on a street using Arduino. The code turns on and off various LEDs and motors based on input from sensors to simulate traffic lights and pedestrian walk signals.
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)
71 views8 pages

Proyecto de Arduino "Calle de Luz": Integrantes: - Jeny Vanessa López Díaz - Valentina Guzmán Porras

This document describes an Arduino project called "Street of Light" created by Jeny Vanessa López Díaz and Valentina Guzmán Porras. It includes a pictorial diagram and code to control different lights and sensors on a street using Arduino. The code turns on and off various LEDs and motors based on input from sensors to simulate traffic lights and pedestrian walk signals.
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/ 8

Proyecto de Arduino

“Calle de Luz”

Integrantes: -Jeny Vanessa López Díaz


-Valentina Guzmán Porras

1003
Proyecto de Arduino
“Calle de Luz”

Integrantes: -Jeny Vanessa López Díaz


-Valentina Guzmán Porras

1003
DIAGRAMA PICTÓRICO:
CÓDIGO:
/*** Function declaration ***/

void setup()

pinMode(A5,INPUT);

Serial.begin(9600);

pinMode(10,OUTPUT);

pinMode(2,INPUT);

pinMode(A3,OUTPUT);

pinMode(3,INPUT);

pinMode(8,OUTPUT);

pinMode(9,INPUT);

pinMode(A4,OUTPUT);

pinMode(13,INPUT);

pinMode(A0,OUTPUT);

pinMode(A1,OUTPUT);

pinMode(A2,OUTPUT);
pinMode(4,INPUT);

pinMode(5,OUTPUT);

pinMode(6,OUTPUT);

pinMode(7,OUTPUT);

pinMode(12,OUTPUT);

void loop()

Serial.println(analogRead(A5));

if (analogRead(A5) < 600) {

digitalWrite(10,HIGH);

}else {

digitalWrite(10,LOW);

if (digitalRead(2) == LOW) {

analogWrite(A3,255);

}else {

analogWrite(A3,0);

if (digitalRead(3) == HIGH) {

digitalWrite(8,HIGH);

}else {

digitalWrite(8,LOW);

if (digitalRead(9) == HIGH) {
analogWrite(A4,255);

}else {

analogWrite(A4,0);

if (digitalRead(13) == HIGH) {

analogWrite(A0,255);

delay(4000);

analogWrite(A0,0);

analogWrite(A1,255);

delay(2000);

analogWrite(A1,0);

analogWrite(A2,255);

delay(4000);

analogWrite(A2,0);

analogWrite(A1,255);

delay(2000);

analogWrite(A1,0);

}else {

if (digitalRead(4) == HIGH) {

digitalWrite(5,HIGH);

delay(50);

digitalWrite(5,LOW);

delay(50);

digitalWrite(6,HIGH);

delay(50);

digitalWrite(6,LOW);

delay(50);

digitalWrite(7,HIGH);

delay(50);

digitalWrite(7,LOW);

delay(50);

digitalWrite(12,HIGH);
delay(50);

digitalWrite(12,LOW);

delay(50);

digitalWrite(12,HIGH);

delay(50);

digitalWrite(12,LOW);

delay(50);

digitalWrite(7,HIGH);

delay(50);

digitalWrite(7,LOW);

delay(50);

digitalWrite(6,HIGH);

delay(50);

digitalWrite(6,LOW);

delay(50);

digitalWrite(5,HIGH);

delay(50);

digitalWrite(5,LOW);

delay(50);

}else {

digitalWrite(5,LOW);

digitalWrite(6,LOW);

digitalWrite(7,LOW);

digitalWrite(12,LOW);

/*** Function definition ***/

You might also like