mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add main.py
This commit is contained in:
parent
d93b3e07e4
commit
c87c9c2bce
24
examples/RTThread/main.py
Normal file
24
examples/RTThread/main.py
Normal file
@ -0,0 +1,24 @@
|
||||
import PikaStdLib
|
||||
import pikaRTThread
|
||||
import pikaRTDevice
|
||||
import PikaDebug
|
||||
|
||||
thread = pikaRTThread.Thread()
|
||||
mem = PikaStdLib.MemChecker()
|
||||
pdb = PikaDebug.Debuger()
|
||||
|
||||
print('mem use max:')
|
||||
mem.max()
|
||||
|
||||
led = pikaRTDevice.GPIO()
|
||||
led.setId(57)
|
||||
led.setMode('out')
|
||||
led.enable()
|
||||
|
||||
pwm = pikaRTDevice.PWM()
|
||||
pwm.setName('tim3pwm1')
|
||||
pwm.setChannel(1)
|
||||
pwm.setFrequency(1000)
|
||||
pwm.setDuty(0.5)
|
||||
pwm.enable()
|
||||
|
Loading…
x
Reference in New Issue
Block a user