浏览代码

在read前,等待0.1秒让机器处理完毕。

JeffWang 2 年之前
父节点
当前提交
3aeec893e7
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Python/baseSerail.py

+ 1 - 0
Python/baseSerail.py

@@ -88,6 +88,7 @@ class BaseSerial():
 
     def read(self, size=0):
         try:
+            time.sleep(0.1) # 必备的等待-机器响应;
             self.exception = None
             # 先读取1个,如果超时表示通讯失败;
             bys = self.ser.read(1)