import time
import machine
potRojo= machine.ADC(28)
potVerde= machine.ADC(27)
potAzul= machine.ADC(26)
ledRojo=machine.Pin(6, machine.Pin.OUT)
ledVerde=machine.Pin(5, machine.Pin.OUT)
ledAzul=machine.Pin(4, machine.Pin.OUT)
anaRojo = machine.PWM(ledRojo)
anaVerde = machine.PWM(ledVerde)
anaAzul = machine.PWM(ledAzul)
anaRojo.freq(1000)
anaAzul.freq(1000)
anaVerde.freq(1000)
while True:
lecturaRojo=potRojo.read_u16() if potRojo.read_u16()>200 else 0
lecturaVerde=potVerde.read_u16() if potVerde.read_u16()>200 else 0
lecturaAzul=potAzul.read_u16() if potAzul.read_u16()>200 else 0
anaRojo.duty_u16(lecturaRojo)
anaVerde.duty_u16(lecturaVerde)
anaAzul.duty_u16(lecturaAzul)
print(lecturaRojo)
print(lecturaVerde)
print(lecturaAzul)
time.sleep_ms(200)