20 lines
331 B
Python
Raw Normal View History

2021-09-11 09:16:21 +08:00
import PikaStdLib
2021-09-08 21:25:52 +08:00
import STM32
2021-09-11 09:16:21 +08:00
mem = PikaStdLib.MemChecker()
2021-09-08 21:25:52 +08:00
time = STM32.Time()
uart = STM32.UART()
uart.init()
uart.setBaudRate(115200)
uart.setId(1)
uart.enable()
2021-09-08 21:25:52 +08:00
while True:
2021-09-11 09:16:21 +08:00
time.sleep_s(1)
readBuff = uart.read(2);
2021-09-11 09:16:21 +08:00
print('mem used max:')
mem.max()
print('read 2 char:')
print(readBuff)
2021-09-13 22:10:44 +08:00
print(' ')