百度网盘下载地址(984):点击下载
#include <reg52.h>
#include <stdio.h>
#include <intrins.h>
#include <absacc.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
//#include "I2C.h"
#include "lcd1602.h"
#include "adc0832.h"
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 smoke[]="000";
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};