#include <LiquidCrystal_I2C.h>
#include <ESP32Servo.h>
LiquidCrystal_I2C lcdSaya(0x27, 16, 2);
Servo servoSaya;
int pot, potPersen, potServo;
void setup() {
lcdSaya.init();
lcdSaya.backlight();
servoSaya.attach(27, 500, 2400);
}
void loop() {
pot = analogRead(14);
potPersen = map(pot, 0,4095, 0,100);
potServo = map(pot, 0,4095, 0,180);
servoSaya.write(potServo);
lcdSaya.setCursor(0,0);
lcdSaya.print("Pot: ");
lcdSaya.print(potPersen);
lcdSaya.print("% ");
lcdSaya.setCursor(0,1);
lcdSaya.print("Servo: ");
lcdSaya.print(potServo);
delay(500);
}