2024-04-19 16:23:09 发布
网友
为什么有时它会起作用?你知道吗
我试着听从命令。你知道吗
我该怎么修?你知道吗
import serial import time port = serial.Serial("/dev/ttyS0", baudrate=115200, timeout=1) port.write('AT'+'\r\n') print port.read(10) time.sleep(.1)
输出
尝试将延迟置于读取之前:
time.sleep(.1) print port.read(10)
也许串行端口保持打开,您需要在再次访问它之前关闭它?你知道吗
尝试将延迟置于读取之前:
也许串行端口保持打开,您需要在再次访问它之前关闭它?你知道吗
相关问题 更多 >
编程相关推荐