from machine import Pin, ADC
import time
pot = ADC(26)
led1 = Pin(2, Pin.OUT)
led2 = Pin(3, Pin.OUT)
led3 = Pin(4, Pin.OUT)
led4 = Pin(5, Pin.OUT)
led5 = Pin(6, Pin.OUT)
while True:
value = pot.read_u16()
led1.off()
led2.off()
led3.off()
led4.off()
led5.off()
if value > 10000:
led1.on()
if value > 20000:
led2.on()
if value > 30000:
led3.on()
if value > 40000:
led4.on()
if value > 50000:
led5.on()
time.sleep(0.1)