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

            作者: 時(shí)間:2016-11-21 來源:網(wǎng)絡(luò) 收藏
            電路圖:
            代碼如下:
            #include
            #include
            sbit RS=0xA0;
            sbit RW=0xA1;
            sbit E=0xA2;
            void lcd_w_cmd(unsigned char com);
            void lcd_w_dat(unsigned char dat);
            unsigned char lcd_r_start();
            void init();
            void delay(unsigned char t);
            void delay1();
            void GONG_ZI()
            {
            lcd_w_cmd(0x40);
            lcd_w_dat(0x1f);
            lcd_w_cmd(0x41);
            lcd_w_dat(0x1f);
            lcd_w_cmd(0x42);
            lcd_w_dat(0x04);
            lcd_w_cmd(0x43);
            lcd_w_dat(0x04);
            lcd_w_cmd(0x44);
            lcd_w_dat(0x04);
            lcd_w_cmd(0x45);
            lcd_w_dat(0x1f);
            lcd_w_cmd(0x46);
            lcd_w_dat(0x1f);
            lcd_w_cmd(0x47);
            lcd_w_dat(0x00);
            }
            void main()
            {
            unsigned char lcd[]="cgyl2010!!";
            unsigned char lcd1[]="linux kernel!!";
            unsigned char i;
            P0=0xff;
            init();
            delay(255);
            delay(255);
            lcd_w_cmd(0x83);
            delay(255);
            for(i=0;i<10;i++)
            {
            lcd_w_dat(lcd[i]);
            delay(200);
            }
            lcd_w_cmd(0xc1);
            delay(255);
            for(i=0;i<14;i++)
            {
            lcd_w_dat(lcd1[i]);
            delay(200);
            }
            while(1);
            }
            void delay(unsigned char t)
            {
            unsigned char j,i;
            for(i=0;i
            for(j=0;j<50;j++);
            }
            void delay1()
            {
            _nop_();
            _nop_();
            _nop_();
            }
            void init()
            {
            lcd_w_cmd(0x3c);
            lcd_w_cmd(0x0e);
            lcd_w_cmd(0x01);
            lcd_w_cmd(0x06);
            lcd_w_cmd(0x80);
            }
            unsigned char lcd_r_start()
            {
            unsigned char s;
            RW=1;
            delay1();
            RS=0;
            delay1();
            E=1;
            s=P0;
            delay1();
            E=0;
            delay1();
            RW=0;
            delay1();
            return s;
            }
            void lcd_w_cmd(unsigned char com)
            {
            unsigned char i;
            do{
            i=lcd_r_start();
            i=i&0x80;
            delay(2);
            }while(i!=0);
            RW=0;
            delay1();
            RS=0;
            delay1();
            E=1;
            delay1();
            P0=com;
            delay1();
            E=0;
            delay1();
            RW=1;
            delay(255);
            }
            void lcd_w_dat(unsigned char dat)
            {
            unsigned char i;
            do{
            i=lcd_r_start();
            i=i&0x80;
            delay(2);
            }while(i!=0);
            RW=0;
            delay1();
            RS=1;
            delay1();
            E=1;
            delay1();
            P0=dat;
            delay1();
            E=0;
            delay1();
            RW=1;
            delay(255);
            }



            關(guān)鍵詞: 單片機(jī)LCD顯示

            評論


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

            關(guān)閉