整理目录结构
This commit is contained in:
31
main.py
31
main.py
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
猪舍主控系统主程序入口
|
||||
"""
|
||||
|
||||
import machine
|
||||
import time
|
||||
# import struct # 根据需要保留或删除
|
||||
# import client_pb # 根据需要保留或删除
|
||||
|
||||
|
||||
def main_loop():
|
||||
"""
|
||||
主循环
|
||||
"""
|
||||
print("猪舍控制系统启动...")
|
||||
|
||||
while True:
|
||||
# 在这里添加你的逻辑
|
||||
time.sleep(1) # 避免空循环占用过多CPU
|
||||
|
||||
# 程序入口
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main_loop()
|
||||
except KeyboardInterrupt:
|
||||
print("程序被中断")
|
||||
except Exception as e:
|
||||
print(f"程序异常: {e}")
|
||||
Reference in New Issue
Block a user