mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
15 lines
246 B
Python
15 lines
246 B
Python
|
import PikaStdLib
|
||
|
import STM32
|
||
|
|
||
|
time = STM32.Time()
|
||
|
uart = STM32.UART()
|
||
|
uart.init()
|
||
|
uart.setBaudRate(115200)
|
||
|
uart.setId(1)
|
||
|
uart.enable()
|
||
|
|
||
|
while True:
|
||
|
time.sleep_ms(500)
|
||
|
readBuff = uart.read(2)
|
||
|
print('read 2 char:')
|
||
|
print(readBuff)
|