我正在测试通过PWM引脚控制LED,注意到Pico Ultra W设备上似乎只有一个LED电源灯。
运行示例 控制PWM(Python程序),没看到明显的LED灯呼吸效果。
使用自己的程序(控制LED灯常亮),也看不到期望的效果,如下是我的程序:
Code: Select all
from periphery import PWM
import time
pwm = PWM(10, 0)
try:
# Configure PWM for constant on
pwm.frequency = 1000 # Frequency (not critical for constant on)
pwm.duty_cycle = 1.0 # 100% duty cycle = fully on
pwm.polarity = "normal" # Normal polarity
pwm.enable() # Enable PWM output
print("LED is now constantly on at full brightness")
print("Press Ctrl+C to exit")
while True:
time.sleep(1) # Keep program running
except KeyboardInterrupt:
print("\nTurning off LED...")
finally:
# Cleanup
pwm.duty_cycle = 0 # Turn off LED
pwm.close()
- 镜像类型:Luckfox_Pico_Ultra_W_EMMC_0429
想请问下问题出现了哪里,是需要增加额外的LED灯,还是需要使用其他的PWM引脚,期待您的答复!