int PIR = 2; // choose the input pin (for PIR sensor)
int val = 0; // variable for reading the pin status
#define LED 5
void setup() {
Serial.begin(9600);
pinMode(PIR, _); // declare sensor as input
pinMode(LED, _);
}
void loop() {
val = digitalRead(PIR); // read input value
Serial.println(val);
_ (val == 0)
digitalWrite(LED, _); //หลอดไฟติด
_
digitalWrite(LED, _); //หลอดไฟดับ
delay(1000);
}