在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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>

            新聞中心

            兩機(jī)串行通訊

            作者: 時(shí)間:2016-11-17 來源:網(wǎng)絡(luò) 收藏
            C代碼:

            /*************** writer:shopping.w ******************/
            #include
            #define uint unsigned int
            #define uchar unsigned char
            sbit LED1 = P1^0;
            sbit LED2 = P1^3;
            sbit K1 = P1^7;
            uchar Operation_NO = 0;
            uchar code DSY_CODE[]=
            {
            0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f
            };

            本文引用地址:http://www.biyoush.com/article/201611/315541.htm

            void Delay(uint x)
            {
            uchar i;
            while(x--)
            {
            for(i=0;i<120;i++);
            }
            }

            void putc_to_SerialPort(uchar c)
            {
            SBUF = c;
            while(TI == 0);
            TI = 0;
            }

            void main()
            {
            LED1=LED2=1;
            P0 = 0x00;
            SCON = 0x50;
            TMOD = 0x20;
            PCON = 0x00;
            TH1 = 0xfd;
            TL1 = 0xfd;
            TI = 0;
            RI = 0;
            TR1 = 1;
            IE = 0x90;
            while(1)
            {
            Delay(100);
            if(K1 == 0)
            {
            while(K1==0);
            Operation_NO=(Operation_NO+1)%4;
            switch(Operation_NO)
            {
            case 0:
            putc_to_SerialPort(X);
            LED1=LED2=1; break;
            case 1:
            putc_to_SerialPort(A);
            LED1=0;LED2=1;break;
            case 2:
            putc_to_SerialPort(B);
            LED2=0;LED1=1;break;
            case 3:
            putc_to_SerialPort(C);
            LED1=0;LED2=0;break;
            }
            }
            }
            }

            void Serial_INT() interrupt 4
            {
            if(RI)
            {
            RI = 0;
            if(SBUF>=0&&SBUF<=9)
            P0 = DSY_CODE[SBUF];
            else
            P0 = 0x00;
            }
            }



            關(guān)鍵詞: 兩機(jī)串行通

            評(píng)論


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

            關(guān)閉