#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
pinMode(4,OUTPUT);
lcd.init();
lcd.backlight();
}
void loop() {
int pir=digitalRead(7);
lcd.setCursor(0,0);
lcd.print(pir);
if(pir==1){
lcd.clear();
lcd.setCursor(0,4);
lcd.print("PERSON ON");
digitalWrite(4, HIGH);
delay(1000);
}
else{
lcd.setCursor(0,1);
lcd.print("PERSON OFF");
digitalWrite(4, LOW);
delay(1000);
}
}