#include <ESP32Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
const int servopin = 27;
Servo servoMotor;
int pg =0;
int Pot =34;
int lerpot=0;
byte Graus[] = {
B00000,
B00111,
B00101,
B00111,
B00000,
B00000,
B00000,
B00000
};
LiquidCrystal_I2C LCD((0x27), 16, 2);
void setup() {
Serial.begin(115200);
servoMotor.attach(servopin);
pinMode(34, INPUT);
LCD.init();
LCD.backlight();
LCD.createChar(0, Graus);
}
void loop() {
lerpot= map(analogRead(Pot),0,4095,0,180);
servoMotor.write(lerpot);
LCD.setCursor(0,0);
LCD.print("Angulo do servo:");
LCD.setCursor(0,1);
LCD.print(lerpot);
LCD.write(0);
LCD.print(" ");
delay(10);
}