#write a micropython script to control the toggling rate of led connected to GPIO4 with respact to knob position of a potentiometer GPIO34 of esp32.
from machine import Pin,ADC
from time import sleep
led=Pin(4,Pin.OUT)
pot=ADC(Pin(34))
pot.atten(ADC.ATTN_11DB)
while True:
rate=pot.read()
print(rate)
led.on()
sleep(0.3)
led.off()
sleep(5)