2022-08-29 11:03:04 +08:00

16 lines
246 B
Python

import PikaStdLib
import machine
time = machine.Time()
uart = machine.UART()
uart.setId(1)
uart.setBaudRate(115200)
uart.enable()
while True:
time.sleep_ms(500)
readBuff = uart.read(2)
print('read 2 char:')
print(readBuff)