from machine import Pin, ADC
import time
time.sleep(0.1) # Wait for USB to become ready
rojo = Pin(0, Pin.OUT)
verde = Pin(1, Pin.OUT)
azul = Pin(2, Pin.OUT)
pot = ADC(Pin(26))
print("Hello, Pi Pico!")
while True:
lectura = pot.read_u16()
if lectura < 10000 :
rojo.on()
elif lectura > 5000 and lectura < 30000:
verde.on()
elif lectura > 30000:
azul.on()
time.sleep(0.1)
rojo.off()
azul.off()
verde.off()