智能家居控制系统C程序
点击数:7387 次 录入时间:03-04 11:54:21 整理:http://www.55dianzi.com 51单片机
//**************************************************************** //
// INT1中断服务程序 //
//**************************************************************** //
unsigned char DTMF;
void service_int1() interrupt 2 using 1
{
EX1=0;
DTMF=P1;
DTMF=DTMF>>4;
}
void main(void)
{
TMOD=0x11;
TH1=0x3c;
TL1=0xb0;
TR1=1;
ET1=1;
IT0=1;
EX0=1;
IT1=0;
EX1=1;
reset();
EA=0;
r_flag=RW24XX(password,6,0x0000,0xa1,M2402);//R
if(P2_0==0)
dlms(20);
if(P2_0==0)
{
ring_flag=1;
mode=1;
passwordflag=1;
ring_count=7;
ring_fluctuation=6;
}
EA=1;
while(1)
{
open();
dog=~dog;
switch(mode)
{
case 0:;
break;
case 1:
TEL=1;
LED=0;//
dlms_time=0;
ring_reset_time=0;
while(dlms_time<40)
{
dlms(1);
TELA=~TELA;
}
ring_reset_time=0;
LED=1;//
TELA=0;
mode++;
DTMF=255;
EX1=1;
LED=switching;
break;
case 2://password
if(DTMF!=255)
{
passwordtest[0]=DTMF;
if(INT1==1)
{
dlms_time=0;
while(dlms_time<2);
if(INT1==1)
{
DTMF=255;
mode++;
dlms_time=0;
while(dlms_time<10)
{
dlms(2);
TELA=~TELA;
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页
本文关键字:智能 控制系统 程序 51单片机,单片机-工控设备 - 51单片机