在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 單片機(jī)模擬汽車轉(zhuǎn)向燈

            單片機(jī)模擬汽車轉(zhuǎn)向燈

            作者: 時間:2016-11-21 來源:網(wǎng)絡(luò) 收藏
            程序?qū)崿F(xiàn)功能,當(dāng)上燈亮低電平上燈亮,其它同樣道理,但兩燈亮低電平時,其它兩個低電平就會使亮燈不能同時亮,代碼如下:
            #include
            sbit P1_0 = P1^0;
            sbit P1_1 = P1^1;
            sbit P2_0 = P2^0;
            sbit P2_1 = P2^1;
            sbit P2_2 = P2^2;
            sbit P0_0 = P0^0;
            void delay(unsigned char i) {
            unsigned int j = 0,k = 0;
            for(k = 0; k < i; k++)
            for(j = 0; j < 255; j++);
            }
            void main(void){
            bit left,right,security;
            while(1) {
            left = P2_0;
            right = P2_1;
            security = P2_2;
            P0_0 = 0;
            if (left != 1 && right == 1) {
            P1_0 = left;
            delay(250);
            }
            if (right != 1 && left == 1) {
            P1_1 = right;
            delay(250);
            }
            if(security != 1 || (left != 1 && right != 1)) {
            //P1_0 = P1_1 = security;
            P1 = 0;
            delay(250);
            P1_0 = 1;
            P1_1 = 1;
            delay(250);
            }
            P1_0 = 1;
            P1_1 = 1;
            delay(500);
            }
            }



            評論


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

            關(guān)閉