欢迎访问《昆明冶金职业大学学报》,

昆明冶金职业大学学报 ›› 2026, Vol. 42 ›› Issue (1): 62-.DOI: 10.3969/j.issn.1009-0479.2026.01.008

• 机械设计制造与自动化技术 • 上一篇    下一篇

单线多路温度测控系统的模块化程序设计探析

  

  1. (1.昆明冶金高等专科学校电气与机械学院,云南昆明650033;2.中国铁路昆明局科学技术研究所,云南昆明650011)
  • 出版日期:2026-02-11 发布日期:2026-06-04
  • 作者简介:杨 宇(1979-),男,云南鹤庆人,教授,工学硕士,主要从事电气自动化技术的教学与研究。
  • 基金资助:
    云南省教育厅科学研究基金项目“基于单片机的单线多路温度测控系统研究”(2023J1521)。

Modular Programming Design for Single‑Bus Multi‑Channel Temperature Measurement and Control System

  1. (1. Faculty of Electrical and Mechanical Engineering, Kunming Metallurgy College, Kunming 650033, China; 2. Science and Technology Research Institute of Kunming Railway Bureau, Kunming 650011, China)
  • Online:2026-02-11 Published:2026-06-04

摘要: 单片机的编程方式分为线性编程和模块化编程。线性编程是一种较为传统的编程方式,程序结构简单、突出过程性,但主程序较为臃肿,程序的功能性比较混乱,程序的可读性和可维护性较差。模块化编程强调系统功能的独立和调用,程序结构清晰,代码的可维护性及复用性较好。在基于单片机的单线多路温度测控系统中,可以将温度检测模块、温度显示模块和延时功能模块进行模块化程序设计,使每个功能模块既保持各自功能的独立性,又具备良好的对外连接能力,程序设计更加科学。

关键词: 单片机, 模块化编程, 单线多路温度测控

Abstract:  The programming methods for microcontrollers can be divided into linear programming and modular programming. Linear programming is a more traditional approach characterized by simple program structure and a strong focus on procedural flow. However, it often results in a bloated main program, disorganized functional logic, and poor readability and maintainability of the code. Modular programming emphasizes functional independence and modular invocation, featuring clear program structure as well as improved code maintainability and reusability. In multi-channel temperature control system based on MCU, modular programming can be applied to functional modules such as temperature detection, temperature display, and time-delay operations. This approach ensures that each functional module maintains its operational independence while retaining connectivity with other functions, thereby resulting in a more systematic and rational program design.

Key words: microcontroller, modularprogramming, multichanneltemperaturecontr

中图分类号: