TEMA 8
ZUMBADOR
const int led=8;
const int pir=2;
void setup() {
pinMode (led,OUTPUT);
pinMode (pir,INPUT);
pinMode (9,OUTPUT);
Serial.begin(9600);
}
void loop() {
delay(1000);
if(digitalRead(pir)==HIGH)
{
digitalWrite (led,HIGH);
digitalWrite (9,HIGH);
Serial.println("Intruso Detectado");
delay(300);
}
else{
digitalWrite(led,LOW);
digitalWrite (9,LOW);
Serial.println("Sin Peligro");
}
}
ZUMBADOR
const int led=8;
const int pir=2;
void setup() {
pinMode (led,OUTPUT);
pinMode (pir,INPUT);
pinMode (9,OUTPUT);
Serial.begin(9600);
}
void loop() {
delay(1000);
if(digitalRead(pir)==HIGH)
{
digitalWrite (led,HIGH);
digitalWrite (9,HIGH);
Serial.println("Intruso Detectado");
delay(300);
}
else{
digitalWrite(led,LOW);
digitalWrite (9,LOW);
Serial.println("Sin Peligro");
}
}
Comentarios
Publicar un comentario