基于51单片机的电子密码锁的设计内容摘要:

dispbuf[2]=16。 dispbuf[3]=16。 dispbuf[4]=16。 dispbuf[5]=16。 dispbuf[6]=16。 dispbuf[7]=16。 keycount=0。 } if(dd) {P3_3=0。 P3_5=1。 P3_4=1。 while(1) {if(!P3_5) { dispbuf[0]=18。 dispbuf[1]=16。 dispbuf[2]=16。 dispbuf[3]=16。 dispbuf[4]=16。 dispbuf[5]=16。 dispbuf[6]=16。 dispbuf[7]=16。 keycount=0。 dd=0。 break。 } if(!P3_4) { ee=1。 dd=0。 dispbuf[0]=18。 dispbuf[1]=16。 dispbuf[2]=16。 dispbuf[3]=16。 dispbuf[4]=16。 dispbuf[5]=16。 dispbuf[6]=16。 dispbuf[7]=16。 keycount=0。 西安文理学院课程设计报告 第 16 页 break。 } } } P3=0xff。 P3_4=0。 temp=P3。 temp=temp amp。 0x0f。 if (temp!=0x0f) { for(i=10。 i0。 i) for(j=248。 j0。 j)。 temp=P3。 temp=temp amp。 0x0f。 if (temp!=0x0f) { temp=P3。 temp=temp amp。 0x0f。 switch(temp) { case 0x0e: key=7。 break。 case 0x0d: key=8。 break。 case 0x0b: key=9。 break。 case 0x07: key=10。 break。 } temp=P3。 P1_1=~P1_1。 if((key=0) amp。 amp。 (key10)) { if(keycount6) { getps[keycount]=key。 if(ee) {ps[keycount]=key。 西安文理学院课程设计报告 第 17 页 } dispbuf[keycount+2]=19。 } keycount++。 if(keycount==6) { keycount=6。 } else if(keycount6) { keycount=6。 keyoverflag=1。 //key overflow } } else if(key==12)//delete key { if(keycount0) { keycount。 getps[keycount]=0。 dispbuf[keycount+2]=16。 } else { keyoverflag=1。 } } else if((key==15)amp。 amp。 (!ee))//enter key { if(keycount!=pslen) { errorflag=1。 rightflag=0。 second3=0。 } else { for(i=0。 ikeycount。 i++) { if(getps[i]!=ps[i]) { i=keycount。 errorflag=1。 西安文理学院课程设计报告 第 18 页 rightflag=0。 second3=0。 goto a。 } } errorflag=0。 rightflag=1。 a: i=keycount。 } } temp=temp amp。 0x0f。 while(temp!=0x0f) { temp=P3。 temp=temp amp。 0x0f。 } keyoverflag=0。 } } P3=0xff。 P3_5=0。 temp=P3。 temp=temp amp。 0x0f。 if (temp!=0x0f) { for(i=10。 i0。 i) for(j=248。 j0。 j)。 temp=P3。 temp=temp amp。 0x0f。 if (temp!=0x0f) { temp=P3。 temp=temp amp。 0x0f。 switch(temp) { case 0x0e: key=4。 break。 case 0x0d: key=5。 break。 case 0x0b: key=6。 西安文理学院课程设计报告 第 19 页 break。 case 0x07: key=11。 break。 } temp=P3。 P1_1=~P1_1。 if((key=0) amp。 amp。 (key10)) { if(keycount6) { getps[keycount]=key。 if(ee) {ps[keycount]=key。 } dispbuf[keycount+2]=19。 } keycount++。 if(keycount==6) { keycount=6。 } else if(keycount6) { keycount=6。 keyoverflag=1。 //key overflow。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。