sbit Speak = P2^7;
sbit RED = P3^3;
sbit GREEN = P3^4;
sbit Relay = P3^2;
sbit KEY1 = P1^3;
sbit KEY2 = P1^4;
sbit KEY3 = P1^5;
sbit KEY4 = P1^6;
sbit KEY5 = P1^7;
unsigned char idata RevBuffer[30];
unsigned char Card_Num;
void iccardcode();
//系统初始化
void InitializeSystem()
{
PcdReset();
PcdAntennaOff();
PcdAntennaOn();
M500PcdConfigISOType( 'A' );
}
unsigned char idata UID[4],Temp[4];
unsigned char Table[3];
unsigned char Num;
unsigned char Count,Countf,Count1,Count2,Count3,Count4,Count5,C_flag;
void Auto_Reader(void)
{
if(PcdRequest(0x52,Temp)==0)
{
if(PcdAnticoll(UID)==0)
{
Speak=0;delay_10ms(20);Speak=1;
Table[0]=UID[0]/100+0x30;
Table[1]=UID[0]/10%10+0x30;
Table[2]=UID[0]%10+0x30;
LCD1602_Disp_ZF(0x80+0x40,"Num: ",16);
LCD1602_Disp_ZF(0x84+0x40,Table,3);
Count = UID[0];
if((Count==Count1)||(Count==Count2)||(Count==Count3)||(Count==Count4)||(Count==Count5))
{
LCD1602_Disp_ZF(0x8a+0x40,"OK ",5);
GREEN = 0;Relay=0;delay_10ms(200);Relay=1;GREEN = 1;
C_flag=1;
}
else
{
LCD1602_Disp_ZF(0x8a+0x40,"Error",5);
RED = 0;delay_10ms(200);RED = 1;
C_flag=2;
}
delay_10ms(200);
LCD1602_Disp_ZF(0x80+0x40,"Please Swipecard",16);
}
}
}
uchar DS1302_Table[7]={0}; //读取时间值
void Display_LCD2(uchar Dis_Hour,uchar Dis_Min,uchar Dis_Sec)
{
uchar Dis_Table[8]="11:22:33";
Dis_Table[0] = Dis_Hour/10+0x30;
Dis_Table[1] = Dis_Hour%10+0x30;
Dis_Table[3] = Dis_Min/10+0x30;
Dis_Table[4] = Dis_Min%10+0x30;
Dis_Table[6] = Dis_Sec/10+0x30;
Dis_Table[7] = Dis_Sec%10+0x30;
LCD1602_Disp_ZF(0x85,Dis_Table,8);
}
|