mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
19 lines
317 B
Python
19 lines
317 B
Python
import PikaStdLib
|
|
import PikaStdDevice
|
|
|
|
time = PikaStdDevice.Time()
|
|
pwm = PikaStdDevice.PWM()
|
|
pwm.setPin('PA8')
|
|
pwm.setFrequency(2000)
|
|
pwm.setDuty(0.5)
|
|
pwm.enable()
|
|
mem = PikaStdLib.MemChecker()
|
|
|
|
while True:
|
|
mem.now()
|
|
time.sleep_ms(500)
|
|
pwm.setDuty(0.5)
|
|
time.sleep_ms(500)
|
|
pwm.setDuty(0.001)
|
|
|