Update demo_uart_many.py

This commit is contained in:
Juwan 2021-03-26 17:42:26 +08:00 committed by GitHub
parent 9a0cd31136
commit d733b4710e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -12,15 +12,14 @@ fm.register(board_info.PIN13, fm.fpioa.UART2_RX, force=True)
uart_A = UART(UART.UART1, 115200, 8, 0, 0, timeout=1000, read_buf_len=4096)
uart_B = UART(UART.UART2, 115200, 8, 0, 0, timeout=1000, read_buf_len=4096)
write_str = b'hello world'
write_bytes = b'hello world'
for i in range(20):
uart_A.write(write_str)
if uart_A.any():
read_data = uart_B.read()
if read_data:
read_str = read_data
print("string = ", read_str)
if read_str == write_str:
print("write_bytes = ", write_bytes)
if read_data == write_bytes:
print("baudrate:115200 bits:8 parity:0 stop:0 ---check Successfully")
uart_A.deinit()