#script that changes the led brightness ,over time by increasing/decreasing
# the duty cycle
#frequecny must be from 1 Hz to 40 MHz
from machine import Pin,PWM
from time import sleep
frequency=5000
led=PWM(Pin(5),frequency)
while True:
for duty_cycle in range(0,1023,1):
led.duty(duty_cycle)
print(duty_cycle)
sleep(0.009)
for duty_cycle in range(1023,0,-1):
led.duty(duty_cycle)
print(duty_cycle)
sleep(0.009)