from machine import Pin, ADC, PWM
import time
time.sleep(0.1) # Wait for USB to become ready
led = PWM(Pin(3), freq=1000)
pot = ADC(0)
while True:
pot_value = pot.read_u16()
led.duty_u16(pot_value)
time.sleep(0.25)
from machine import Pin, ADC, PWM
import time
time.sleep(0.1) # Wait for USB to become ready
led = PWM(Pin(3), freq=1000)
pot = ADC(0)
while True:
pot_value = pot.read_u16()
led.duty_u16(pot_value)
time.sleep(0.25)