19 lines
320 B
Arduino
19 lines
320 B
Arduino
|
byte sensorMov = 7;
|
||
|
byte led = 8;
|
||
|
|
||
|
void setup() {
|
||
|
pinMode(sensorMov, INPUT);
|
||
|
pinMode(led, OUTPUT);
|
||
|
Serial.begin(9600);
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
if(digitalRead(sensorMov) == HIGH) {
|
||
|
Serial.println("Inciando detección de movimiento");
|
||
|
digitalWrite(led, HIGH);
|
||
|
delay(1000);
|
||
|
digitalWrite(led, LOW);
|
||
|
}
|
||
|
}
|
||
|
|