from machine import Pin, PWM, ADC
# Crear objetos
pot = ADC(0)
led = Pin(16, Pin.OUT)
ch = PWM(led)
ch.freq(1000) # 1000 Hz
# Super lazo
while True:
duty = pot.read_u16()
ch.duty_u16(duty)
print(duty)from machine import Pin, PWM, ADC
# Crear objetos
pot = ADC(0)
led = Pin(16, Pin.OUT)
ch = PWM(led)
ch.freq(1000) # 1000 Hz
# Super lazo
while True:
duty = pot.read_u16()
ch.duty_u16(duty)
print(duty)