#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(3,0);
if(pir==1){
lcd.clear();
lcd.print(pir);
lcd.setCursor(0,1);
lcd.print("PERSON DEDUCTED");
digitalWrite(4, HIGH);
delay(1000);
}
else{
lcd.clear();
lcd.print(pir);
lcd.setCursor(0,1);
lcd.print(" NOT DEDUCTED ");
digitalWrite(4, LOW);
delay(1000);
}
}