from machine import Pin, I2C
import utime
from ssd1306 import SSD1306_I2C
WIDTH = 128
HEIGHT = 64
pot = machine.ADC(0)
i2c = I2C(0, scl = Pin(1), sda = Pin(0), freq = 400000)
oled = SSD1306_I2C(128, 64, i2c)
while True:
a_val = pot.read_u16()
v_read=round(3*a_val/65535,2)
print(v_read)
utime.sleep(0.1)
oled.text("Voltage", 0,0)
oled.text(str(v_read)+"V", 0,20)
oled.show()