#include <reg52.h>
#include "./lcd/lcd.h"
#include "./delay/delay.h"
unsigned int irtime;
bit startflag = 0;
unsigned char irdata[33] ;
bit irok;
unsigned char ircode[4];
unsigned char ir_process()
{
unsigned char i,j,k;
unsigned char temp;
k = 1;
for(j = 0; j < 4; j++)
{
for(i = 0; i < 8; i++)
{
temp >>= 1;
if(irdata[k] > 6)
{
temp += 0x80;
}
k++;
}
ircode[j] = temp;
}
if((ircode[0]+ircode[1] == 0xff) && (ircode[2]+ircode[3] == 0xff))
{
switch(ircode[2])
{
case 0x16: return 0;
case 0x0c: return 1;
case 0x18: return 2;
case 0x5e: return 3;
case 0x08: return 4;
case 0x1c: return 5;
case 0x5a: return 6;
case 0x42: return 7;
case 0x52: return 8;
case 0x4a: return 9;
case 0x45: return 10;
51单片机—实时时钟
最新推荐文章于 2023-10-27 09:17:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)