#define pyroelectric 14
#define LED_PIN 2 // Define the pin number for the LED
void setup() {
Serial.begin(9600);
pinMode(pyroelectric,INPUT);
}
void loop() {
boolean pyroelectric_val =
digitalRead(pyroelectric);
Serial.print("pyroelectric value =");
Serial.println(pyroelectric_val);
if (pyroelectric_val == 1) {
digitalWrite(LED_PIN, HIGH);
// Turn on LED if value is 1
} else {
digitalWrite(LED_PIN, LOW);
// Turn off LED if value is 0
}
delay(500);
}