mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
16 lines
264 B
Python
16 lines
264 B
Python
import PikaStdLib
|
|
import PikaStdDevice
|
|
|
|
time = PikaStdDevice.Time()
|
|
uart = PikaStdDevice.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)
|
|
|