#include <LiquidCrystal.h>
LiquidCrystal lcd(22,23,5,17,16,4);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(2, INPUT);
pinMode(15, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int x =digitalRead(2);
if(x==1){
digitalWrite(19, HIGH);
Serial.println("object detected ");
delay(500);
}
else {
digitalWrite(19,LOW);
Serial.println("no object detected");
delay(500);
}
}