Tareas Arduino 2, 3 y 4
Tareas Arduino 2, 3 y 4
Tareas Arduino 2, 3 y 4
#include <Servo.h>
Servo Motor;
Void setup(){
Motor .attach(9);
pinMode(pin,OUTPUT);
Void loop() {
Motor.write(i);
Delay(timer);
// secuencia de led
digitalWrite(led,1);
delay(1000);
digitalWrite(led,0);
delay(1000);
}
//Sonido
Tone(6,380);
Delay(3000);
noTone(6);
Motor.write(i);
Delay(timer);
}
Tarea # 3
Int LEDRNS=2;
Int LEDANS=3;
Int LEDVNS=4;
Int LEDRSN=5;
Int LEDASN=6;
Int LEDVSN=7;
Int LEDREO=8;
Int LEDAEO=9;
Int LEDVEO=10;
Int LEDROE=11;
Int LEDAOE=12;
Int LEDVOE=13;
Void setup ()
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
Void loop()
delay(8000);
delay(1000);
delay(1000);
delay(1000);
delay(3000);
delay(8000);//
delay(1000);
delay(1000);
delay(3000);
delay(8000);//
delay(1000);
delay(1000);
delay(1000);
delay(3000);
delay(8000);//
delay(1000);//
delay(1000);//
delay(1000);//
digitalWrite(12, HIGH);//AMARILLO O-E
delay(3000);//
Tarea # 4
Int BUTTON1=2;
Int BUTTON2=3;
Int BUTTON3=4;
Int LED1=5;
Int LED2=6;
Int LED3=7;
Int LED4=8;
Int LED5=9;
Int LED6=10;
Int LED7=11;
Int LED8=12;
Void setup ()
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
Void loop()
If(digitalRead(2)==LOW)
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
If(digitalRead(3)==LOW)
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay(1000);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
If(digitalRead(4)==LOW)
{
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
delay(1000);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
delay(1000);
}}