#define PIR_PIN 15
#define LED_PIN 18
void setup() {
pinMode(PIR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial1.begin(115200);
Serial1.println("Hello Raspberry Pi Pico");
}
void loop() {
int pirState = digitalRead(PIR_PIN);
if (pirState == HIGH) {
Serial1.println("Motion Detected");
digitalWrite(LED_PIN, HIGH);
delay(500);
} else {
Serial1.println("No Motion");
digitalWrite(LED_PIN, LOW);
delay(500);
}
}