在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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-02 來源:網(wǎng)絡(luò) 收藏

            6.匯編源程序

            T5HZ EQU 30H

            T7HZ EQU 31H

            T05SA EQU 32H

            T05SB EQU 33H

            FLAG BIT 00H

            STOP BIT 01H

            SP1 BIT P3.7

            ORG 00H

            LJMP START

            ORG 0BH

            LJMP INT_T0

            START: MOV TMOD,#02H

            MOV TH0,#06H

            MOV TL0,#06H

            SETB ET0

            SETB EA

            NSP: JB SP1,NSP

            LCALL DELY10MS

            JB SP1,NSP

            SETB TR0

            MOV T5HZ,#00H

            MOV T7HZ,#00H

            MOV T05SA,#00H

            MOV T05SB,#00H

            CLR FLAG

            CLR STOP

            JNB STOP,$

            LJMP NSP

            DELY10MS: MOV R6,#20

            D1: MOV R7,#248

            DJNZ R7,$

            DJNZ R6,D1

            RET

            INT_T0: INC T05SA

            MOV A,T05SA

            CJNE A,#100,NEXT

            MOV T05SA,#00H

            INC T05SB

            MOV A,T05SB

            CJNE A,#20,NEXT

            MOV T05SB,#00H

            JB FLAG,STP

            CPL FLAG

            LJMP NEXT

            STP: SETB STOP

            CLR TR0

            LJMP DONE

            NEXT: JB FLAG,S5HZ

            INC T7HZ

            MOV A,T7HZ

            CJNE A,#03H,DONE

            MOV T7HZ,#00H

            CPL P1.0

            LJMP DONE

            S5HZ: INC T5HZ

            MOV A,T5HZ

            CJNE A,#04H,DONE

            MOV T5HZ,#00H

            CPL P1.0

            LJMP DONE

            DONE: RETI

            END

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

            #include AT89X51.H>

            unsigned char t5hz;

            unsigned char t7hz;

            unsigned int tcnt;

            bit stop;

            bit flag;

            void main(void)

            {

            unsigned char i,j;

            TMOD=0x02;

            TH0=0x06;

            TL0=0x06;

            ET0=1;

            EA=1;

            while(1)

            {

            if(P3_7==0)

            {

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

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

            if(P3_7==0)

            {

            t5hz=0;

            t7hz=0;

            tcnt=0;

            flag=0;

            stop=0;

            TR0=1;

            while(stop==0);

            }

            }

            }

            }

            void t0(void) interrupt 1 using 0

            {

            tcnt++;

            if(tcnt==2000)

            {

            tcnt=0;

            if(flag==0)

            {

            flag=~flag;

            }

            else

            {

            stop=1;

            TR0=0;

            }

            }

            if(flag==0)

            {

            t7hz++;

            if(t7hz==3)

            {

            t7hz=0;

            P1_0=~P1_0;

            }

            }

            else

            {

            t5hz++;

            if(t5hz==4)

            {

            t5hz=0;

            P1_0=~P1_0;

            }

            }

            }


            上一頁(yè) 1 2 下一頁(yè)

            評(píng)論


            相關(guān)推薦

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

            關(guān)閉