}
/*┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
函数:遥控短按处理
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈*/
void KZ0()
{
switch(NEC[2])
{
case 0x12: P10 = !P10; break;
case 0x05: break;
case 0x1E: break;
case 0x55: break;
case 0x01: break;
case 0x1B: break;
case 0x03: break;
case 0x6B: break;
case 0x07: break;
case 0x08: break;
case 0x09: break;
case 0x68: break;
case 0x22: break;
case 0xE6: break;
case 0x33: break;
case 0xE2: break;
default:break;
}
}
/*┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
函数:遥控长按处理
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈*/
void KZ1()
{
switch(NEC[2])
{
case 0x12: P14 = !P14; break;
case 0x05: break;
case 0x1E: break;
case 0x55: break;
case 0x01: break;
case 0x1B: break;
case 0x03: break;
case 0x6B: break;
case 0x07: break;
case 0x08: break;
case 0x09: break;
case 0x68: break;
case 0x22: break;
case 0xE6: break;
case 0x33: break;
case 0xE2: break;
default:break;
}
}
/*********************数码管扫描*************************/
void XS(void)
{
if(++Xn > 7)Xn=0;
switch(Xn)
{
case 0: WX8=1; NOP; //屏蔽上个位显
SE=tab[X1]; //送段码
WX1=0; //开位显
break;
case 1: WX1=1; NOP; SE=tab[X2]; WX2=0; break;
case 2: WX2=1; NOP; SE=tab[X3]; WX3=0; break;
case 3: WX3=1; NOP; SE=tab[X4]; WX4=0; break;
case 4: WX4=1; NOP; SE=tab[16]; WX5=0; break;
case 5: WX5=1; NOP; SE=tab[16]; WX6=0; break;
case 6: WX6=1; NOP; SE=tab[X5]; WX7=0; break;
case 7: WX7=1; NOP; SE=tab[X6]; WX8=0; break;
default:break;
}
}
return Key; //返回键值
}
/*┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
函数:散转程序
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈*/
void SanZhuan()
{
uint8 v;
v = KEY(); //键盘检测
switch(v)
{
case 0x7e:ZZ(tab[0]);break;
case 0xbe:ZZ(tab[1]);break;
case 0xde:ZZ(tab[2]);break;
case 0xee:ZZ(tab[3]);break;
case 0x7d:ZZ(tab[4]);break;
case 0xbd:ZZ(tab[5]);break;
case 0xdd:ZZ(tab[6]);break;
case 0xed:ZZ(tab[7]);break;
case 0x7b:ZZ(tab[8]);break;
case 0xbb:ZZ(tab[9]);break;
case 0xdb:ZZ(tab[10]);break;
case 0xeb:ZZ(tab[11]);break;
case 0x77:ZZ(tab[12]);break;
case 0xb7:ZZ(tab[13]);break;
case 0xd7:ZZ(tab[14]);break;
case 0xe7:ZZ(tab[15]);break;
default:break;
}
v=0;
}