#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C LCD(0x27, 16, 2);
#define pot 34
int p = 0, ps = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
LCD.init();
LCD.backlight();
LCD.setCursor(0,0);
LCD.print(" by Gabriel luz ");
LCD.setCursor(0,1);
delay(1000);
LCD.clear();
}
void loop() {
p = analogRead(pot);
ps = map(p, 0, 4095, 0, 100);
LCD.setCursor(0,0);
LCD.print(p);
LCD.print(" ");
LCD.setCursor(0,1);
LCD.print(ps);
LCD.print(" % ");
delay(10);
}