Code: Select all
import machine, utime, gc
LED = machine.Pin(15, machine.Pin.OUT)
potentiometer = machine.ADC(27)
while True:
LED.toggle()
utime.sleep_ms((potentiometer.read_u16() // 100))
print(gc.mem_free())
print(potentiometer.read_u16()//100)