#include #include #include #include #include #include #define uchar unsigned char #define uint unsigned int //上次按键和当前按键序号,该矩阵中序号范围 0~ 15,16 表示无按键 uchar pre_keyno=16,keyno=16; uchar code Title_Text[]="your password
";//标题字符串 uchar DSY_BUFFER[16]=" ";//显示缓冲 uchar userpassword[7]=" ";//用户输入的密码 uchar IIC_Password[7]; uchar IS_Valid_User = 0; uchar i = 0; void Beep(); uchar Clear_Password(); sbit LED_OPEN = P2^0;//开锁灯亮 sbit BEEP = P3^7;//蜂鸣器 //=================================================== //延时
void delay(uint x) { uchar i; while (x--) for(i=0;i