4×4键盘及8位数码管显示构成的电子密码锁
[10-10 20:38:44] 来源:http://www.88dzw.com 电子制作 阅读:8252次
文章摘要:{if(keycount!=pslen){errorflag=1;rightflag=0;second3=0;}else{for(i=0;i<keycount;i++){if(getps[i]!=ps[i]){i=keycount;errorflag=1;rightflag=0;second3=0;goto a4;}}errorflag=0;rightflag=1;a4: i=keycount;}}temp=temp & 0x0f;while(temp!=0x0f){temp=P3;temp=temp & 0x0f;}keyoverflag=0;//?????????}}P3=0xff;
4×4键盘及8位数码管显示构成的电子密码锁,标签:电子小制作,http://www.88dzw.com{
if(keycount!=pslen)
{
errorflag=1;
rightflag=0;
second3=0;
}
else
{
for(i=0;i<keycount;i++)
{
if(getps[i]!=ps[i])
{
i=keycount;
errorflag=1;
rightflag=0;
second3=0;
goto a4;
}
}
errorflag=0;
rightflag=1;
a4: i=keycount;
}
}
temp=temp & 0x0f;
while(temp!=0x0f)
{
temp=P3;
temp=temp & 0x0f;
}
keyoverflag=0;//?????????
}
}
P3=0xff;
P3_6=0;
temp=P3;
temp=temp & 0x0f;
if (temp!=0x0f)
{
for(i=10;i>0;i--)
for(j=248;j>0;j--);
temp=P3;
temp=temp & 0x0f;
if (temp!=0x0f)
{
temp=P3;
temp=temp & 0x0f;
switch(temp)
{
case 0x0e:
key=1;
break;
case 0x0d:
key=2;
break;
case 0x0b:
key=3;
break;
case 0x07:
key=12;
break;
}
temp=P3;
P1_1=~P1_1;
if((key>=0) && (key<10))
{
if(keycount<6)
{
getps[keycount]=key;
dispbuf[keycount+2]=19;
}
keycount++;
if(keycount==6)
{
keycount=6;
}
else if(keycount>6)
{
keycount=6;
keyoverflag=1;//key overflow
}
}
else if(key==12)//delete key
{
if(keycount>0)
{
keycount--;
getps[keycount]=0;
dispbuf[keycount+2]=16;
}
else
{
keyoverflag=1;
}
}
else if(key==15)//enter key
{
if(keycount!=pslen)
{
errorflag=1;
rightflag=0;
second3=0;
}
else
{
for(i=0;i<keycount;i++)
{
if(getps[i]!=ps[i])
{
i=keycount;
errorflag=1;
rightflag=0;
second3=0;
goto a3;
}
}
errorflag=0;
rightflag=1;
a3: i=keycount;
}
}
temp=temp & 0x0f;
while(temp!=0x0f)
{
temp=P3;
temp=temp & 0x0f;
}
keyoverflag=0;//?????????
}
}
P3=0xff;
P3_7=0;
temp=P3;
temp=temp & 0x0f;
if (temp!=0x0f)
{
for(i=10;i>0;i--)
for(j=248;j>0;j--);
temp=P3;
temp=temp & 0x0f;
if (temp!=0x0f)
{
temp=P3;
temp=temp & 0x0f;
switch(temp)
{
case 0x0e:
key=0;
break;
case 0x0d:
key=13;
break;
case 0x0b:
key=14;
break;
case 0x07:
key=15;
break;
}
temp=P3;
P1_1=~P1_1;
if((key>=0) && (key<10))
{
if(keycount<6)
{
getps[keycount]=key;
dispbuf[keycount+2]=19;
}
keycount++;
if(keycount==6)
{
keycount=6;
}
else if(keycount>6)
{
keycount=6;
keyoverflag=1;//key overflow
}
}
else if(key==12)//delete key
{
if(keycount>0)
{
keycount--;
getps[keycount]=0;
dispbuf[keycount+2]=16;
}
else
{
keyoverflag=1;
}
}
else if(key==15)//enter key
{
if(keycount!=pslen)
{
errorflag=1;
rightflag=0;
second3=0;
}
else
{
for(i=0;i<keycount;i++)
{
if(getps[i]!=ps[i])
{
i=keycount;
errorflag=1;
rightflag=0;
second3=0;
goto a2;
}
}
errorflag=0;
rightflag=1;
a2: i=keycount;
}
}
temp=temp & 0x0f;
while(temp!=0x0f)
{
temp=P3;
temp=temp & 0x0f;
}
keyoverflag=0;//?????????
}
}
}
}
void t0(void) interrupt 1 using 0
{
TH0=(65536-500)/256;
TL0=(65536-500)%256;
flashcount++;
if(flashcount==8)
{
flashcount=0;
P0=dispcode[dispbuf[dispcount]];
P2=dispbit[dispcount];
dispcount++;
if(dispcount==8)
{
dispcount=0;
}
}
if((errorflag==1) && (rightflag==0))
Tag:电子制作,电子小制作,维修教程知识 - 电子制作
- 上一篇:51系列I/O口上拉电阻使用点滴
《4×4键盘及8位数码管显示构成的电子密码锁》相关文章
- › IBM T42P笔记本电池充不上电的故障
- › 玩游戏提示缺少D3DX9_42.dll文件解决
- › 康佳T5442E型彩电自动搜索不存台的一个特例
- › 康佳T5442E型彩电自动搜索不存台检修后的体会
- › LG PDP42V6等离子屏电源板维修时的注意事项
- › 关于使用3842芯片的电路故障位置判断
- 在百度中搜索相关文章:4×4键盘及8位数码管显示构成的电子密码锁
- 在谷歌中搜索相关文章:4×4键盘及8位数码管显示构成的电子密码锁
- 在soso中搜索相关文章:4×4键盘及8位数码管显示构成的电子密码锁
- 在搜狗中搜索相关文章:4×4键盘及8位数码管显示构成的电子密码锁
编辑推荐
最新更新
热门排行