from machine import Pin, ADC
import utime
Led0 = machine.Pin(25,machine.Pin.OUT)
Led1 = machine.Pin(18,machine.Pin.OUT)
Led2 = machine.Pin(19,machine.Pin.OUT)
Led3 = machine.Pin(20,machine.Pin.OUT)
pot = ADC(Pin(27))
while True:
Led1.value(1)
val=pot.read_u16()
print(val)
utime.sleep(0.2)
if val > 55000:
Led1.value(1)
Led2.value(1)
Led3.value(1)
elif val > 40000:
Led1.value(1)
Led2.value(1)
Led3.value(0)
elif val > 25000:
Led1.value(1)
Led2.value(0)
Led3.value(0)
else:
Led1.value(1)
Led2.value(0)
Led3.value(0)