from machine import Pin, ADC
import utime
potenciometro= ADC(0)
led= Pin(18, Pin.OUT)
led2= Pin(4, Pin.OUT)
led3= Pin(7, Pin.OUT)
while True:
valor=potenciometro.read_u16()
print(valor)
utime.sleep_ms(500)
if valor < 27000:
led.value(1)
else:
led.value(0)
if valor >= 27000 and valor < 43000:
led2.value(1)
else:
led2.value(0)
if valor >= 43000:
led3.value(1)
else:
led3.value(0)