Explorar el Código

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

JeffWang hace 2 años
padre
commit
3aeec893e7
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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)