17 lines
258 B
Python
Raw Normal View History

2021-10-04 10:04:06 +08:00
import PikaStdLib
2021-11-21 16:32:30 +08:00
import STM32G0
2021-10-04 10:04:06 +08:00
2021-11-21 16:32:30 +08:00
time = STM32G0.Time()
uart = STM32G0.UART()
2021-10-04 10:04:06 +08:00
uart.init()
uart.setId(1)
uart.setBaudRate(115200)
2021-10-04 10:04:06 +08:00
uart.enable()
while True:
time.sleep_ms(500)
readBuff = uart.read(2)
print('read 2 char:')
2021-10-04 11:00:35 +08:00
print(readBuff)