在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)密碼鎖設(shè)計(jì)

            單片機(jī)密碼鎖設(shè)計(jì)

            作者: 時(shí)間:2013-04-03 來(lái)源:網(wǎng)絡(luò) 收藏

            5.C語(yǔ)言源程序

            #include AT89X52.H>

            unsigned char code ps[]={1,2,3,4,5};

            unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,

            0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x40};

            unsigned char pslen=9;

            unsigned char templen;

            unsigned char digit;

            unsigned char funcount;

            unsigned char digitcount;

            unsigned char psbuf[9];

            bit cmpflag;

            bit hibitflag;

            bit errorflag;

            bit rightflag;

            unsigned int second3;

            unsigned int aa;

            unsigned int bb;

            bit alarmflag;

            bit exchangeflag;

            unsigned int cc;

            unsigned int dd;

            bit okflag;

            unsigned char oka;

            unsigned char okb;

            void main(void)

            {

            unsigned char i,j;

            P2=dispcode[digitcount];

            TMOD=0x01;

            TH0=(65536-500)/256;

            TL0=(65536-500)%6;

            TR0=1;

            ET0=1;

            EA=1;

            while(1)

            {

            if(cmpflag==0)

            {

            if(P3_6==0) //function key

            {

            for(i=10;i>0;i--)

            for(j=248;j>0;j--);

            if(P3_6==0)

            {

            if(hibitflag==0)

            {

            funcount++;

            if(funcount==pslen+2)

            {

            funcount=0;

            cmpflag=1;

            }

            P1=dispcode[funcount];

            }

            else

            {

            second3=0;

            }

            while(P3_6==0);

            }

            }

            if(P3_7==0) //digit key

            {

            for(i=10;i>0;i--)

            for(j=248;j>0;j--);

            if(P3_7==0)

            {

            if(hibitflag==0)

            {

            digitcount++;

            if(digitcount==10)

            {

            digitcount=0;

            }

            P2=dispcode[digitcount];

            if(funcount==1)

            {

            pslen=digitcount;

            templen=pslen;

            }



            關(guān)鍵詞: 單片機(jī) 密碼鎖 AT89S51

            評(píng)論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉