Auto-Garden/Scripts/flashing_led.py
2025-11-04 17:30:24 -05:00

14 lines
245 B
Python

from machine import Pin, PWM
from time import sleep
pwm = PWM(Pin(12))
pwm.freq(5000)
while True:
for duty in range(65025):
pwm.duty_u16(duty)
sleep(0.0005)
for duty in range(65025, 0, -1):
pwm.duty_u16(duty)
sleep(0.0005)