#write a micropython script that changes led brightness over time by inccreasing or decreasing the duty cycle
from machine import Pin,PWM
from time import sleep
led = PWM(Pin(22), 5000)
while True:
for x in range(0,1023,10):
led.duty(x)
print(x)
sleep(0.1)
sleep(1)
for y in range(1023,0,-1):
led.duty(y)
sleep(0.1)
print(y)
sleep(2)