生活随笔
收集整理的這篇文章主要介紹了
基于单片机火灾监测报警系统设计-毕设资料
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
資料下載地址-1041(百度網盤):點擊下載
說明:K1設置按鍵,用來設置設定報警溫度和煙霧濃度。
K2增加,K3減少。K4確定,只有確定后設置的報警值才有用。
設定報警數值后,當溫度或者煙霧濃度達到設定值就會報警。
#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};
總結
以上是生活随笔為你收集整理的基于单片机火灾监测报警系统设计-毕设资料的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。