from machine import Pin, ADC
import utime
potenciometro= ADC(0)
ledr= Pin(18, Pin.OUT)
ledv= Pin(5, Pin.OUT)
leda= Pin(11, Pin.OUT)
while True:
valor= potenciometro.read_u16()
print(valor)
utime.sleep_ms(500)
if valor < 27000:
ledr.value(1)
else:
ledr.value(0)
if valor >=27000 and valor<43000:
ledv.value(1)
else:
ledv.value(0)
if valor >=43000:
leda.value(1)
else:
leda.value(0)