基于单片机十路温度报警系统仿真设计

1469下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0

 

 

#include "lcd1602.h"
#include "ds18b20.h"
#include "DS1302.h"
#include "24C16B.h"
sbit WN=P3^7;
sbit X0=P3^2;
sbit X1=P3^3;
uchar n=1,count=0,smb=0;
extern char zhen_temp[5],*wendu;
extern bit flag;
uchar code ds18b20_num1[8]={0xfd,0x00,0x00,0x00,0xb8,0xc5,0x45,0x28};
uchar code ds18b20_num2[8]={0x8e,0x00,0x00,0x00,0xb8,0xc5,0x30,0x28};
uchar code ds18b20_num3[8]={0xb9,0x00,0x00,0x00,0xb8,0xc5,0x31,0x28};
uchar code ds18b20_num4[8]={0xe0,0x00,0x00,0x00,0xb8,0xc5,0x32,0x28};
uchar code ds18b20_num5[8]={0x86,0x00,0x00,0x00,0xb8,0xc0,0x01,0x28};
uchar code ds18b20_num6[8]={0xdf,0x00,0x00,0x00,0xb8,0xc0,0x02,0x28};
uchar code ds18b20_num7[8]={0xe8,0x00,0x00,0x00,0xb8,0xc0,0x03,0x28};
uchar code ds18b20_num8[8]={0x6d,0x00,0x00,0x00,0xb8,0xc0,0x04,0x28};
void delay(unsigned int time)
{
	unsigned int i,j;
	for(i=0;i<time;i++)
		for(j=0;j<200;j++);
}
 /**********************************************************************
 -------------------外部中断0的中断服务程序----------------------------
 **********************************************************************/
 void int_0(void)interrupt 0 using 0	
{ 
	delay(15);// 延时消抖
	while(!X0);//等按键抬起
    smb=!smb;	 //允许报警标志
	WN=0;		

}

 

 

  

posted @ 2021-03-16 14:55  roadroad  阅读(77)  评论(0编辑  收藏  举报
电设屋
上千套电子毕设课设方案