i want to display information from infrared sensor to lcd using arduino uno

Hello,
I want to write a program that would detect a movement with the infrared sensor and then display information on an LCD.everything is working good the lcd showing the text that i putted, and while testing the sensor , next to an obstacle it shows 1005 or 1004 (working) and ithout obstacle it shows 0 , i didn’t find a code on th internet, here is my code and i hope that u help me adding this and thank you <3

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#include <Servo.h>

Servo myservo;

int pos = 0;

void setup() {
Serial.begin(9600); //cap
myservo.attach(9); //servo
lcd.begin(16,2); //lcd
}

void loop() {
Serial.println(analogRead(A0)); //cap
delay(10);
for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
lcd.scrollDisplayRight();
delay(10);
}
lcd.setCursor(0,0);
lcd.print(“liweaeddinne”);
lcd.setCursor(0,1);
lcd.print(“hassinne”);
delay(300);

for (pos = 0; pos <= 180; pos += 1) {
// in steps of 1 degree
myservo.write(pos);
delay(15);
}
for (pos = 180; pos >= 0; pos -= 1) {
myservo.write(pos);
delay(15);
}

}

naggati.ino (852 Bytes)