Files
pig-house-controller/main.py

32 lines
614 B
Python
Raw Normal View History

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
猪舍主控系统主程序入口
"""
2025-09-25 20:14:48 +08:00
import machine
import time
2025-10-07 20:11:19 +08:00
# import struct # 根据需要保留或删除
# import client_pb # 根据需要保留或删除
2025-09-25 20:14:48 +08:00
def main_loop():
"""
主循环
"""
print("猪舍控制系统启动...")
while True:
2025-10-07 20:11:19 +08:00
# 在这里添加你的逻辑
time.sleep(1) # 避免空循环占用过多CPU
2025-09-25 20:14:48 +08:00
# 程序入口
if __name__ == "__main__":
try:
main_loop()
except KeyboardInterrupt:
print("程序被中断")
except Exception as e:
2025-10-07 20:11:19 +08:00
print(f"程序异常: {e}")