#include <Servo.h>
#include <LiquidCrystal.h>
const int potPin = A0;
const int servoPin = 9;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
int potValue = 0;
Servo myServo;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
myServo.attach(servoPin);
lcd.begin(16, 2);
lcd.print("Position/Value: ");
}
void loop() {
potValue = analogRead(potPin);
int servoAngle = map(potValue, 0, 1023, 0, 180);
myServo.write(servoAngle);
lcd.setCursor(0, 1);
lcd.print(potValue);
delay(100);
}