#include <LiquidCrystal_I2C.h>
#define led A1
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int pot = A0;
const float voltagem = 5.0;
void setup() {
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Pot Voltagem:");
pinMode(led, OUTPUT);
pinMode(pot, INPUT);
}
void loop() {
int potValor = analogRead(pot);
float potVoltage = (potValor / 1023.0) * voltagem;
int ledBrilho = map(potValor, 0, 1023, 0, 255);
analogWrite(led, ledBrilho);
lcd.setCursor(0, 1);
lcd.print(potValor);
lcd.print(" ");
lcd.print(potVoltage);
lcd.print("V ");
}