2021-10-04 10:04:06 +08:00
|
|
|
import PikaStdLib
|
2022-02-20 20:25:59 +08:00
|
|
|
import machine
|
2021-10-04 10:04:06 +08:00
|
|
|
|
2022-02-20 20:25:59 +08:00
|
|
|
time = machine.Time()
|
|
|
|
pwm = machine.PWM()
|
2021-10-04 10:04:06 +08:00
|
|
|
pwm.setPin('PA8')
|
|
|
|
pwm.setFrequency(2000)
|
|
|
|
pwm.setDuty(0.5)
|
|
|
|
pwm.enable()
|
2022-03-18 00:02:43 +08:00
|
|
|
mem = PikaStdLib.MemChecker()
|
2021-10-04 10:04:06 +08:00
|
|
|
|
|
|
|
while True:
|
2022-03-18 00:02:43 +08:00
|
|
|
mem.now()
|
2021-10-04 10:04:06 +08:00
|
|
|
time.sleep_ms(500)
|
|
|
|
pwm.setDuty(0.5)
|
|
|
|
time.sleep_ms(500)
|
2021-10-04 11:19:17 +08:00
|
|
|
pwm.setDuty(0.001)
|
2021-10-04 10:59:55 +08:00
|
|
|
|