2021-10-04 10:59:55 +08:00

17 lines
247 B
Python

import PikaStdLib
import STM32
time = STM32.Time()
pwm = STM32.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.3)