from machine import Pin, PWM, ADC
import time
led = PWM(Pin(15), freq=1000)
pot = ADC(Pin(34))
while True:
pot_value = pot.read()
duty = int(pot_value / 4095 * 1023)
led.duty(duty)
time.sleep(0.01)
from machine import Pin, PWM, ADC
import time
led = PWM(Pin(15), freq=1000)
pot = ADC(Pin(34))
while True:
pot_value = pot.read()
duty = int(pot_value / 4095 * 1023)
led.duty(duty)
time.sleep(0.01)