#wmps that changes the LED brightness over time by inc/decreasing the duty cycle.
from machin import Pin, PWM
from time import sleep
frequency=5000
led=PWM(Pin(5),frequency)
while True:
for duty_cycle in range(0, 1024, 1):
led.duty(duty_cycle)
print(duty_cycle)
sleep(0.005)
for duty_cycle in range (1023,0,-1):
led.duty(duty_cycle)
print(duty_cycle)
sleep(0.005)