19 lines
320 B
C++
Executable File
19 lines
320 B
C++
Executable File
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);
|
|
}
|
|
}
|
|
|