hvs2中增加氮气阀门控制
This commit is contained in:
@@ -23,6 +23,7 @@ def main():
|
||||
|
||||
light_state_update_time = 0.0
|
||||
xray_off_time = 0.0
|
||||
last_valve_time = 0.0
|
||||
|
||||
while True:
|
||||
try:
|
||||
@@ -47,8 +48,15 @@ def main():
|
||||
light_state_update_time = time.time()
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
if time.time() - last_valve_time > 10.0:
|
||||
io_module.control_valve(13, True)
|
||||
time.sleep(1)
|
||||
io_module.control_valve(13, False)
|
||||
last_valve_time = time.time()
|
||||
except KeyboardInterrupt:
|
||||
print("程序收到中断信号,正在退出...")
|
||||
io_module.control_valve(13, False)
|
||||
io_module.stop()
|
||||
hv_service.stop()
|
||||
mqtt_client.stop()
|
||||
|
||||
Reference in New Issue
Block a user