这是一个周界报警的报警控制程序,采用89C52芯片,KEIL 51开发!

源代码在线查看: input.c

软件大小: 67 K
上传用户: feitiandy001
关键词: 89C52 KEIL 报警 报警控制
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				//scan the Alarm input
				#include "reg52.h"
				#include "main.h"
				
				
				unsigned char data in_buf = 0;
				unsigned char data i;
				unsigned char data in_status = 0;
				unsigned char data P0_status;
				extern P0_buf;
				extern P2_buf;
				extern bit Ysd_flag;
				
				
				extern void delay50us(unsigned char count);
				
				extern void input(void)
				{
				 LE = 0;
				 for(i=0;i				{
				 P0 = 0xFF & (0xFF-i);
				 delay50us(1);
				 if(com_input == 0)
				  {
				   in_status = 0x01				   P0_buf = P0_buf | in_status;
				  }
				 else
				  {
				   in_status = 0x01				   in_status = ~in_status;
				   P0_buf = P0_buf & in_status;
				  }
				 }
				 delay50us(1);
				 P0 = ~P0_buf;
				
				 P2_buf = P0_buf; 
				 P0_buf = P0;
				 LE = 1;
				 }
							

相关资源