Simulation design of smoke alarm system based on single-chip microcomputer - complete course design information

[Resource download] The download address is as follows: 1535:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

Multiple alarm ranges, displaying the current alarm range value through different LED indicators. The alarm range value can be set by buttons.

//程序头文件
#include <reg51.h>
//显示函数头文件
#include <display.h>

//宏定义
#define uint unsigned int 
#define uchar unsigned char
#define Data_ADC0809 P1		//定义Data_ADC0809为P1口
 
//管脚声明
sbit LED_R= P2^2; //红灯
sbit LED_Y= P2^1; //黄灯
sbit LED_G= P2^0; //绿灯
sbit Feng = P2^5; //蜂鸣器
sbit san=P3^4;	  //风扇
//ADC0809
sbit ST=P3^3;
sbit EOC=P3^6;
sbit OE=P3^2;
//按键
sbit Key1=P2^6;	   //设置键
sbit Key2=P2^7;	   //加键
sbit Key3=P3^7;	   //减键


//函数声明
extern uchar ADC0809();
extern void Key();

void delay(uint z)	//延时函数,大约延时z ms
{
	uint i,j;
	for(i=0;i<z;i++)
	for(j=0;j<121;j++);
}

Guess you like

Origin blog.csdn.net/AuroraFaye/article/details/115052561