添加电容同步采集功能
This commit is contained in:
@ -166,6 +166,9 @@ class ClassCapRead:
|
|||||||
if connectedSensorCnt > 1 and (time.time() - self.syncTimer) > DEF_CDC_SYNC_MS:
|
if connectedSensorCnt > 1 and (time.time() - self.syncTimer) > DEF_CDC_SYNC_MS:
|
||||||
self.syncTimer = time.time()
|
self.syncTimer = time.time()
|
||||||
self.set_sensor_enable(connectedSensorChan)
|
self.set_sensor_enable(connectedSensorChan)
|
||||||
|
for fingerIndex in range(0, len(self.fingers)):
|
||||||
|
if self.fingers[fingerIndex].connect is True:
|
||||||
|
self.fingers[fingerIndex].snsCmd.setSensorSync(0)
|
||||||
|
|
||||||
if self.connectStatus == EnumCh341ConnectStatus.CH341_CONNECT_CHECK:
|
if self.connectStatus == EnumCh341ConnectStatus.CH341_CONNECT_CHECK:
|
||||||
capReadTime = time.time()
|
capReadTime = time.time()
|
||||||
|
|||||||
@ -250,6 +250,24 @@ class ClassSensorCmd:
|
|||||||
#print(f"time={time.time()},len(buf) = {len(buf)}, tarLen={tarLen}, buf[0]={buf[0]}, buf[1]={buf[1]}, sum={checkSum}")
|
#print(f"time={time.time()},len(buf) = {len(buf)}, tarLen={tarLen}, buf[0]={buf[0]}, buf[1]={buf[1]}, sum={checkSum}")
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# 设置采集同步
|
||||||
|
# addr:传感器地址
|
||||||
|
def setSensorSync(self, addr):
|
||||||
|
_pack = list()
|
||||||
|
_pack.append(0xAA)
|
||||||
|
_pack.append(0x55)
|
||||||
|
_pack.append(0x03)
|
||||||
|
_pack.append(self.CMD_SET_SENSOR_CDC_SYNC)
|
||||||
|
_pack.append(0x00)
|
||||||
|
_pack.append(0x00)
|
||||||
|
_pack.append(0x00)
|
||||||
|
_pack.append(0x00)
|
||||||
|
_pack.append(0x00)
|
||||||
|
self.calcSum(_pack)
|
||||||
|
self._ch341.write(addr, _pack)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user