logo

使用串口只能发送数据但不能接收数据?

2019-07-17 12:06
Z
_2clp

看的是教程视频,用的是里面的代码,还以为是板子没插好,然后用了万用表测了确实是接通了的

import time
from pyb import UART

# Always pass UART 3 for the UART number for your OpenMV Cam.
# The second argument is the UART baud rate. For a more advanced UART control
# example see the BLE-Shield driver.
uart = UART(3, 9600, timeout_char=1000)

while(True):
    #uart.write("Hello World!\r\n")
    #time.sleep(1000)
    if uart.any():
          a = uart.readline()
          print(a)
2019-07-17 13:55
I
网红小智智 星瞳科技

https://singtown.com/learn/50240/

按照视频,一模一样的操作。使用一样的串口调试扩展板,一样的星瞳串口助手。

如果不行,联系卖家维修。