int pirPin = 13;
void setup() {
pinMode(pirPin, INPUT);
Serial.begin(115200);
}
void loop() {
int motion = digitalRead(pirPin);
if (motion == HIGH) {
Serial.println("Motion Detected!");
} else {
Serial.println("No Motion Detected!");
}
delay(500);
}int pirPin = 13;
void setup() {
pinMode(pirPin, INPUT);
Serial.begin(115200);
}
void loop() {
int motion = digitalRead(pirPin);
if (motion == HIGH) {
Serial.println("Motion Detected!");
} else {
Serial.println("No Motion Detected!");
}
delay(500);
}