基于单片机烟雾及温度报警器-火灾监测-毕设课设资料

【资源下载】下载地址如下1537:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

说明:K1设置按键,用来设置设定报警温度和烟雾浓度。K2增加,K3减少。K4确定,只有确定后设置的报警值才有用。设定报警数值后,当温度或者烟雾浓度达到设定值就会报警。

sbit K1= P1^2;
sbit K2= P1^3;
sbit K3= P1^4;
sbit K4= P1^5;
sbit K5= P1^6;
sbit K6= P1^7;
sbit DQ= P2^7;

sbit BUZZ= P2^6;

 
uchar tmpdisplay[8]; //定义显示缓存数组
bit read_flag=0;	//定义读时钟标志位
bit mode=0;	  		//显示模式0正常1设定

uchar set_position=0;

uchar set_tempure=0;     //设定温度
uchar set_smokescope=0;	 //设定浓度
int real_tempure=0;		//实际温度
uchar real_smokescope=0; //实际烟雾浓度

uchar cursor_position=0;//光标位置
	
uchar  time_counter_50ms=0;
uchar  smokescope=0;
uchar  first_read_tempe=0;//第一次读取温度数值


unsigned char t[2],*pt;				//用来存放温度值,测温程序就是通过这个数组与主函数通信的
unsigned char  TempBuffer1[10]={0x2b,0x30,0x30,0x30,0x2e,0x30,0x30,0xdf,0x43,'\0'};//{0x2b,0x31,0x32,0x32,0x2e,0x30,0x30,0xdf,0x43,'\0'};
								//显示实时温度,上电时显示+122.00C
/*
unsigned char  TempBuffer0[16]={0x54,0x48,0x3a,0x2b,0x31,0x32,0x35,0x20,
								0x54,0x4c,0x3a,0x2b,0x31,0x32,0x34,'\0'};	*/
								//显示温度上下限,上电时显示TH:+125 TL:+124C							
unsigned char code dotcode[4]={0,25,50,75};


/***因显示分辨率为0.25,但小数运算比较麻烦,故采用查表的方法*******
再将表值分离出十位和个位后送到十分位和百分位********************/

void covert1(void)	//将温度转换为LCD显示的数据
{
	
   unsigned char x=0x00,y=0x00;

猜你喜欢

转载自blog.csdn.net/AuroraFaye/article/details/115052656