from machine import Pin,ADC
from time import sleep_ms
Rled=Pin(14,Pin.OUT)
Bled=Pin(12,Pin.OUT)
pot=ADC(Pin(13))
pot.atten(ADC.ATTN_11DB)
while True:
pot_value=pot.read()
led.value(1)
sleep_ms(pot_value)
led.value(0)
sleep_ms(pot_value)