from machine import Pin, ADC
import time
from o2litepy import O2lite

pot = ADC(Pin(34))
pot.atten(ADC.ATTN_11DB)  # full range: 3.3v
led = Pin(5, Pin.OUT)

o2l = O2lite()
o2l.initialize("adctest")  # ensemble name

while True:
    pot_value = pot.read()
    print(pot_value)
    o2l.send_cmd("/useadc/1/fader2", 0, "f", pot_value / 4095.0)
    o2l.sleep(0.05)
