在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,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首頁 > 模擬技術 > 設計應用 > 16 16點陣顯示程序(含電路圖)

            16 16點陣顯示程序(含電路圖)

            作者: 時間:2011-08-16 來源:網絡 收藏

            以下是程序.

            #include"config.h"

            #defineDOTLED_LINE_PORTPORTB
            #defineDOTLED_LINE_DDRDDRB
            #defineDOTLED_LINE_PINPINB

            #defineDOTLED_LINE_SCKTPB1
            #defineDOTLED_LINE_SCKHPB5
            #defineDOTLED_LINE_SDAPB3

            #defineDOTLED_ROW_PORTPORTC
            #defineDOTLED_ROW_DDRDDRC
            #defineDOTLED_ROW_PINPINC

            #defineDOTLED_ROW_A0PC0
            #defineDOTLED_ROW_A1PC1
            #defineDOTLED_ROW_A2PC2
            #defineDOTLED_ROW_A3PC3
            #defineDOTLED_ROW_EPC4



            uint8font[]={
            /*--調入了一幅圖像:這是您新建的圖像--*/
            /*--寬度x高度=16x16--*/
            0x00,0x00,0x00,0x00,0x08,0x38,0x18,0x44,0x08,0x44,0x08,0x04,0x08,0x08,0x08,0x10,
            0x08,0x20,0x08,0x40,0x08,0x40,0x08,0x40,0x3E,0x7C,0x00,0x00,0x00,0x00,0x00,0x00
            };



            staticvoidTransmitByte(uint8byte);
            staticvoidSelectRow(uint8row);
            staticvoidFlipLatchLine(void);


            staticvoidTransmitByte(uint8byte)
            {
            uint8i;

            for(i=0;i8;i++)
            {
            if(byte(1i))
            {
            DOTLED_LINE_PORT|=_BV(DOTLED_LINE_SDA);
            }
            else
            {
            DOTLED_LINE_PORT=~_BV(DOTLED_LINE_SDA);
            }
            //__delay_cycles(100);
            DOTLED_LINE_PORT|=_BV(DOTLED_LINE_SCKH);
            //__delay_cycles(100);
            DOTLED_LINE_PORT=~_BV(DOTLED_LINE_SCKH);
            //__delay_cycles(100);
            }
            }

            staticvoidSelectRow(uint8row)
            {
            //row-=1;
            row|=DOTLED_ROW_PIN0xe0;
            DOTLED_ROW_PORT=row;
            }

            staticvoidFlipLatchLine(void)
            {
            DOTLED_LINE_PORT|=_BV(DOTLED_LINE_SCKT);
            DOTLED_LINE_PORT=~_BV(DOTLED_LINE_SCKT);
            }

            voidInitDotLedPort(void)
            {
            DOTLED_LINE_PORT=~(_BV(DOTLED_LINE_SCKT)|_BV(DOTLED_LINE_SCKH));
            DOTLED_LINE_PORT|=_BV(DOTLED_LINE_SDA);
            DOTLED_LINE_DDR|=_BV(DOTLED_LINE_SCKT)|_BV(DOTLED_LINE_SCKH)|_BV(DOTLED_LINE_SDA);

            DOTLED_ROW_PORT|=0x1f;
            DOTLED_ROW_PORT=0xf0;
            DOTLED_ROW_DDR|=0x1f;
            }
            voidEnableRow(booleanIsEnable)
            {
            if(IsEnable)
            {
            DOTLED_ROW_PORT=~_BV(DOTLED_ROW_E);
            }
            else
            {
            DOTLED_ROW_PORT|=_BV(DOTLED_ROW_E);
            }
            }
            voidPrintDotLed(uint8*buffer)
            {
            uint8i,tmp;

            for(i=0;i16;i++)
            {
            tmp=*buffer++;
            TransmitByte(~tmp);
            tmp=*buffer++;
            TransmitByte(~tmp);
            SelectRow(i);
            FlipLatchLine();
            }
            }
            voidmain(void)
            {
            InitDotLedPort();

            EnableRow(TRUE);

            while(1)
            {
            PrintDotLed(font);
            __delay_cycles(5000);
            }

            }

            //---------------------------------------------------------------------------
            config.h文件

            #ifndef_CONFIG_H
            #define_CONFIG_H

            //#defineGCCAVR

            #defineCPU_CYCLES7372800L




            #ifndefGCCAVR
            #define_BV(bit)(1(bit))
            #endif


            #defineMSB0x80
            #defineLSB0x01


            #defineFALSE0
            #defineTRUE1


            typedefunsignedcharuint8;
            typedefunsignedintuint16;
            typedefunsignedlonguint32;
            typedefunsignedcharboolean;


            #includeioavr.h>
            #includeinavr.h>

            #include"dotled.h"


            #endif


            //---------------------------------------------------------------------------

            16 16點陣顯示電路

            電路圖符號相關文章:電路圖符號大全




            評論


            相關推薦

            技術專區(qū)

            關閉