在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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è) > 光電顯示 > 設(shè)計(jì)應(yīng)用 > 創(chuàng)意設(shè)計(jì)之LED搖搖棒

            創(chuàng)意設(shè)計(jì)之LED搖搖棒

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

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

            電路非常簡(jiǎn)單,用一個(gè)多小時(shí)就搞定了,效果還不錯(cuò)吧?

            1.jpg

            這是做的

            2.jpg

            傳感器特寫,想想看,水銀開關(guān)為什么是斜著裝置的。

            3.jpg3.jpg

            發(fā)光二極管接P0口和P2口,傳感器用了中斷0,圖中的K2為水銀開關(guān)。

            電原理圖

            4.jpg

            C語(yǔ)言源程序

            #include

            char KY;

            unsigned char code GB_16[] =

            {

            0x00,0x00,0x00,0x00,0x1F,0xE0,0x0F,0xC0, //中

            0x08,0x40,0x08,0x40,0x08,0x40,0xFF,0xFF,

            0x7F,0xFE,0x08,0x40,0x08,0x40,0x08,0x40,

            0x0F,0xE0,0x1F,0xC0,0x08,0x00,0x00,0x00,

            0x00,0x00,0x00,0x00,0xFF,0xFF,0x7F,0xFE, //國(guó)

            0x40,0x0A,0x49,0x0A,0x49,0x0A,0x4F,0xFA,

            0x4F,0xFA,0x49,0xCA,0x5B,0x7A,0x49,0x2A,

            0x40,0x0A,0x7F,0xFF,0xFF,0xFE,0x40,0x00,

            0x00,0x00,0x08,0x01,0x08,0x0E,0xFF,0xFC, //加

            0x7F,0xF0,0x08,0x04,0x08,0x02,0x0F,0xFF,

            0x1F,0xFE,0x08,0x00,0x3F,0xFE,0x1F,0xFC,

            0x10,0x08,0x10,0x08,0x1F,0xFE,0x3F,0xFC,

            0x00,0x00,0x08,0x20,0x87,0x1E,0x72,0x7F, //油

            0x31,0xC6,0x06,0x00,0x00,0x00,0x1F,0xFF,

            0x0F,0xFE,0x08,0x42,0xFF,0xFE,0x7F,0xFE,

            0x08,0x42,0x0F,0xFF,0x1F,0xFE,0x08,0x00

            };

            void DelayUs(unsigned int N)

            {

            unsigned int x;

            for(x=0; x=N;x++);

            }

            void intersvr0(void) interrupt 0 using 1

            {

            int i;

            KY=~KY;

            if(KY==0){

            DelayUs(1200);

            for(i=0;i64;i++){

            P2=~GB_16[i*2];

            P0=~GB_16[i*2+1];

            DelayUs(80);

            P2=0xff;P0=0xff;

            }

            }

            }

            /*演示主程序*/

            void main(void)

            {

            IT0=1;EX0=1;

            EA=1;

            KY=0;

            P0=0xff;

            P2=0xff;

            while(1){

            }

            }



            評(píng)論


            相關(guān)推薦

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

            關(guān)閉