#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo myServo;
const int potPin = A0;
const int servoPin = 9;
void setup() {
lcd.begin(16, 2);
lcd.backlight();
myServo.attach(servoPin);
}
void loop() {
int potValue = analogRead(potPin);
int angle = map(potValue, 0, 1023, 0, 180);
myServo.write(angle);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Angle: ");
lcd.print(angle);
lcd.print(" degrees");
delay(100);
}