Initial commit: 上传完整代码
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import time
|
||||
|
||||
from config import *
|
||||
from sensor import SensorService
|
||||
from mqtt_client import mqtt_client
|
||||
|
||||
def main():
|
||||
|
||||
sensor_service = SensorService()
|
||||
|
||||
sensor_service.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(0.1)
|
||||
except KeyboardInterrupt:
|
||||
print("程序收到中断信号,正在退出...")
|
||||
sensor_service.stop()
|
||||
mqtt_client.stop()
|
||||
break
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user