//#include
#include
#include
#include
#include
void defor()
{int i,j,k;
for(i=0;i<=20;i++)
{for(j=0;j<=250;j++)
{k=0;}
}
}
//void defor()
//{
//int i,j,k;
//for(i=0;i<=20;i++){
// for(j=0;j<=250;j++){
// k=0;}
//}
char dujian()
{ char tt;
char kn[4]={0x10,0x20,0x40,0x80};
int i,k;
i=1;
//PORTA=0x0f;
//if(PIND!=0x0f)
//{//
PORTA=0x01;
//defor();
//defor();
for (i=0;i<=3;i++)
{//defor();
//defor();
PORTA=PORTA*2;
//defor()
//
if(PIND!=0x0F)
{ defor();
if(PIND==0X0E)
{
while(PIND==0X0E)
{tt=0x01+(kn[i]);
//defor();
}
break;
}
if(PIND==0X0D)
{
while(PIND==0X0D)
{tt=0x02+(kn[i]);
//defor();
}
break;
}
if(PIND==0X0B)
{
while(PIND==0X0B)
{tt=0x04+(kn[i]);
//defor();
}
break;
}
if(PIND==0X07)
{
while(PIND==0X07)
{tt=0x08+(kn[i]);
//defor();
}
break;
}
}
//}
else
{tt=0x00;
}
}
//}
//PORTA=!PORTA;
return tt;
}
char fanyi (char tt)
{char kt[4][4]={{0x37,0x34,0x31,0x2e},{0x38,0x35,0x32,0x30},{0x39,0x36,0x33,0x3d},{0x2f,0x2a,0x2d,0x2b}};
int i;
char mm;
int j;
if(tt==0x00)
{mm=0x00;}
else
{
for (i=0 ;i<=3 ;i++)
{
if(((tt&0x0f)>