#Creating a Dimmable Led (PWM)
from machine import Pin,PWM
from time import sleep
ledPin=5
analogOut=PWM(Pin(ledPin))
analogOut.freq(1000)
analogOut.duty_u16(0)
while True :
print("Enter Voltage : ")
inpvoltage=float(input())
convVoltage=(65535/3.3) * inpvoltage
analogOut.duty_u16(int(convVoltage))
sleep(1)