mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
17 lines
255 B
Python
17 lines
255 B
Python
import PikaStdLib
|
|
import STM32G0
|
|
|
|
time = STM32G0.Time()
|
|
pwm = STM32G0.PWM()
|
|
pwm.setPin('PA8')
|
|
pwm.setFrequency(2000)
|
|
pwm.setDuty(0.5)
|
|
pwm.enable()
|
|
|
|
while True:
|
|
time.sleep_ms(500)
|
|
pwm.setDuty(0.5)
|
|
time.sleep_ms(500)
|
|
pwm.setDuty(0.001)
|
|
|