mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add SmartLoong bsp
This commit is contained in:
parent
20542e1e7d
commit
828898a105
41
bsp/SmartLoong/main.py
Normal file
41
bsp/SmartLoong/main.py
Normal file
@ -0,0 +1,41 @@
|
||||
import PikaStdLib
|
||||
import pikaRTThread
|
||||
import SmartLoong
|
||||
thread = pikaRTThread.Thread()
|
||||
mem = PikaStdLib.MemChecker()
|
||||
print('mem use max(byte): ')
|
||||
print(int(mem.getMax() * 1000))
|
||||
|
||||
led1 = SmartLoong.LED()
|
||||
led1.setId(1)
|
||||
led1.enable()
|
||||
led1.on()
|
||||
|
||||
key1 = SmartLoong.KEY()
|
||||
key1.setId(1)
|
||||
key1.enable()
|
||||
|
||||
i = 0
|
||||
while i < 3:
|
||||
i = i + 1
|
||||
led1.on()
|
||||
thread.mdelay(500)
|
||||
led1.off()
|
||||
thread.mdelay(500)
|
||||
|
||||
num_press = 0
|
||||
led_is_on = 0
|
||||
while num_press < 3:
|
||||
if key1.read() == 0:
|
||||
num_press = num_press + 1
|
||||
print('press num:')
|
||||
print(num_press)
|
||||
if led_is_on:
|
||||
led1.off()
|
||||
led_is_on = 0
|
||||
thread.mdelay(500)
|
||||
else:
|
||||
led1.on()
|
||||
led_is_on = 1
|
||||
thread.mdelay(500)
|
||||
thread.mdelay(50)
|
BIN
bsp/SmartLoong/pikaPackage.exe
Normal file
BIN
bsp/SmartLoong/pikaPackage.exe
Normal file
Binary file not shown.
5
bsp/SmartLoong/requestment.txt
Normal file
5
bsp/SmartLoong/requestment.txt
Normal file
@ -0,0 +1,5 @@
|
||||
pikascript-core==v1.2.9
|
||||
PikaStdLib==v1.2.5
|
||||
pikaRTBooter==v1.0.0
|
||||
pikaRTThread==v1.0.1
|
||||
SmartLoong==latest
|
Loading…
x
Reference in New Issue
Block a user