Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from machine import Pin, PWM
- import time
- # Initialize the LED pin for PWM
- led = PWM(Pin(15))
- led.freq(1000)
- while True:
- for duty_cycle in range(0, 1024):
- led.duty_u16(duty_cycle)
- time.sleep(0.005)
- for duty_cycle in range(1023, -1, -1):
- led.duty_u16(duty_cycle)
- time.sleep(0.005)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement