2021-10-01 00:21:50 +08:00
|
|
|
import PikaStdLib
|
2021-10-19 08:15:01 +08:00
|
|
|
import STM32
|
|
|
|
import PikaPiZero
|
2021-10-01 00:21:50 +08:00
|
|
|
|
|
|
|
uart = STM32.UART()
|
|
|
|
uart = STM32.UART()
|
|
|
|
rgb = PikaPiZero.RGB()
|
|
|
|
mem = PikaStdLib.MemChecker()
|
|
|
|
|
|
|
|
uart.init()
|
|
|
|
uart.setId(1)
|
|
|
|
uart.setBaudRate(115200)
|
|
|
|
uart.enable()
|
|
|
|
|
2021-10-22 22:28:54 +08:00
|
|
|
iic = STM32.IIC()
|
|
|
|
iic.init()
|
|
|
|
iic.setPinSDA('PB0')
|
|
|
|
iic.setPinSCL('PB1')
|
|
|
|
iic.setDeviceAddr(88)
|
|
|
|
iic.enable()
|
2021-10-22 22:37:05 +08:00
|
|
|
print(iic.read(0, 4))
|
2021-10-01 00:21:50 +08:00
|
|
|
|
|
|
|
print('hello 2')
|
|
|
|
print('mem used max:')
|
2021-10-22 22:37:05 +08:00
|
|
|
mem.max()
|
2021-10-16 12:59:00 +08:00
|
|
|
|
2021-10-21 19:00:38 +08:00
|
|
|
i = 0
|
|
|
|
while i < 100:
|
|
|
|
i = i + 1
|
|
|
|
print(i)
|
2021-10-10 10:57:13 +08:00
|
|
|
|
2021-10-21 19:00:38 +08:00
|
|
|
print('Hello PikaScript!')
|