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

            單片機點陣LED燈

            作者: 時間:2016-11-21 來源:網(wǎng)絡 收藏
            電路圖如下:

            代碼如下:
            #include
            unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
            //unsigned char code tab[]={0x7f,0xbf,0xdf,0xef,0xfe,0xfd,0xfb,0xf7};
            unsigned char code graph[3][8]={ {0x21,0x32,0xac,0x6c,0x32,0x21,0x3a,0x7f},
            {0x00,0x02,0x04,0x0a,0xff,0x08,0x04,0x02},
            {0xe1,0x55,0x55,0xdf,0x55,0x55,0x43,0x71}
            };
            unsigned char count;
            unsigned char cnta;
            sbit P1_0 = P1^0;
            void main(void) {
            unsigned char i,j;
            TMOD=0x01;
            TH0=(65536-4000)/256;
            TL0=(65536-4000)%6;
            TR0=1;
            ET0=1;
            EA=1;
            while(1) {
            if(P1_0==0) {
            for(i=5;i>0;i--)
            for(j=248;j>0;j--);
            if(P1_0==0) {
            count++;
            if(count==3) {
            count=0;
            }
            while(P1_0==0);
            }
            }
            }
            }
            void t0(void) interrupt 1 using 0 {
            TH0=(65536-4000)/256;
            TL0=(65536-4000)%6;
            P2=tab[cnta];
            P3=graph[count][cnta];
            cnta++;
            if(cnta==8) {
            cnta=0;
            }
            }



            關鍵詞: 單片機點陣LED

            評論


            技術專區(qū)

            關閉