import time
import board
import pwmio
import analogio
led_red = pwmio.PWMOut(board.GP2, frequency=1000, duty_cycle=0)
potentiometer = analogio.AnalogIn(board.GP27)
while True:
led_red.duty_cycle = potentiometer.value
time.sleep(0.01)import time
import board
import pwmio
import analogio
led_red = pwmio.PWMOut(board.GP2, frequency=1000, duty_cycle=0)
potentiometer = analogio.AnalogIn(board.GP27)
while True:
led_red.duty_cycle = potentiometer.value
time.sleep(0.01)