from machine import Pin , ADC ,I2C
from time import sleep
from esp32_i2c_lcd import I2cLcd
LCD_pin = I2C(scl = Pin(22) , sda = Pin(21), freq = 100000)
lcd = I2cLcd( LCD_pin , 39 , 2 , 16)
lcd.show_cursor()
VR = ADC(Pin(34))
VR.atten(ADC.ATTN_11DB)
while True:
lcd.clear()
bit = VR.read()
# print(bit)
lcd.putstr(str(bit))
volt = ((3.3/4095)*bit)
lcd.move_to(0,1)
lcd.putstr(str(volt))
print(volt)
sleep(0.3)