新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 密碼鎖設計(4×4鍵盤及8位數碼管)

        密碼鎖設計(4×4鍵盤及8位數碼管)

        作者: 時間:2013-04-02 來源:網絡 收藏

        }

        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;ikeycount;i++)

        {

        if(getps[i]!=ps[i])

        {

        i=keycount;

        errorflag=1;

        rightflag=0;

        second3=0;

        goto a;

        }

        }

        errorflag=0;

        rightflag=1;

        a: i=keycount;

        }

        }

        temp=temp 0x0f;

        while(temp!=0x0f)

        {

        temp=P3;

        temp=temp 0x0f;

        }

        keyoverflag=0;//?????????

        }

        }

        P3=0xff;

        P3_5=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=4;

        break;

        case 0x0d:

        key=5;

        break;

        case 0x0b:

        key=6;

        break;

        case 0x07:

        key=11;

        break;

        }

        temp=P3;

        P1_1=~P1_1;

        if((key>=0) (key10))

        {

        if(keycount6)

        {

        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;ikeycount;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) (key10))

        {

        if(keycount6)

        {

        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;ikeycount;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;

        }



        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 鹤山市| 滕州市| 固安县| 杭锦后旗| 肃南| 沁水县| 永州市| 仁布县| 轮台县| 淮安市| 吉安市| 河南省| 赤水市| 苍梧县| 师宗县| 瓮安县| 灵武市| 泸水县| 巴塘县| 崇阳县| 阳谷县| 冕宁县| 英山县| 桦川县| 达拉特旗| 达日县| 济阳县| 藁城市| 英山县| 卓资县| 隆德县| 弋阳县| 九寨沟县| 瑞安市| 阳山县| 景宁| 永年县| 遂昌县| 商河县| 扶沟县| 保康县|