#write a micropy scrept to controle toggle rate of an led connected to gpio4
#with respect to the knob position of a pot connected to gpio 34 of esp32
print("Hello, ESP32!")
from machine import Pin, ADC, PWM
from time import sleep_ms
led = Pin(16, Pin.OUT)
pot = ADC(Pin(35))
pot.atten(ADC.ATTN_11DB) #3.3v
pot.width(ADC.WIDTH_10BIT)
while True:
pot_value = pot.read()
led.on()
sleep_ms(pot_value)
led.off()
sleep_ms(pot_value)
print(pot_value/1000,"s")