import machine
import PWM
import Pin
#Setup a GPIO pin for output
mist = Pin(21, Pin.OUT)
#50% duty cycle. 0.5 second on and 0.5 second off
pwm = PWM(mist, freq=1700000, duty=50)
#Wait
time.sleep_ms(10000)
#Switch off the LED
mist.low()
#deinitialize/stop the timer
pwm.deinit()