from machine import Pin, ADC, PWM
from time import sleep

print("Hello, ESP32!")
sensor = ADC(15)
sensor.atten(ADC.ATTN_11DB)

L1 = PWM(Pin(32))
L1.freq(2)


while True:
    val = sensor.read()
    duty = int(val /4)
    L1.duty(duty)
    print("Potenciometro: ", val, "; pwm Duty:", duty )
    sleep(0.1)