int PIR = 5; // choose the input pin (for PIR sensor)
int val = 0; // variable for reading the pin status
void setup() {
pinMode(PIR, INPUT); // declare sensor as input
Serial.begin(9600);
}
void loop() {
val = digitalRead(PIR); // read input value
Serial.println(val);
delay(1000);
}