基于51单片机红外编码解码的C语言程序
#include
#include
#define uchar unsigned char
#define uint unsigned int
sbit studylamp=P2^7;
sbit lamp=P2^6;
sbit studykey=P3^2;
sbit remotein=P1^1;
sbit remoteout=P1^0;
sbit txkey=P2^0;
uint i,j,m=255,n,k,s;
uchar idata remotedata[206];
uint head;
uint remdata;
//一毫秒延时程序
delay1ms(uint t)
{
for(i=0;i
}
//初始化函数
clearmen()
{
{
}
IE=0x00;
IP=0x01;
TMOD=0x22;
PCON=0X00;
TH1=0xf3;
TL1=0xf3;
IT0=1;
EX0=1;
EA=1;
}
//键功能函数
void key_tx()
{
if(txkey==0)
{
}
}
//主函数
void main()
{
clearmen();
while(1)
{
}
}
//40KHz发生器
void time_intt1(void) interrupt 3
{
remoteout=~remoteout;
}
//外中断0
void intt0(void) interrupt 0
{
ET1=0;TR1=0;EX0=0;EA=0;
head=0;
while(studykey==0);
studylamp=0;lamp=1;
while(remotein==1);
head=0;
while(remotein==0)
{
}
n=0;remdata=0x0000;
while(1)
{
}
end: lamp=0;studylamp=0;
}
51单片机红外编码解码C语言程 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)