import time
import machine
# print(machine.Pin(2))
p23 = machine.Pin(2, machine.Pin.OUT)
led = machine.PWM(p23)
print(led)
def pulse(l, t):
for i in range(20):
l.duty(int(math.sin(i / 10 * math.pi) * 500 + 500))
time.sleep_ms(t)
pulse(led, 50)