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