<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 1602液晶顯示C語言編寫

          1602液晶顯示C語言編寫

          作者: 時間:2016-11-23 來源:網(wǎng)絡(luò) 收藏
          先聲明這個程序不是本人寫的,是郭天翔51視頻教程里的程序,原來開始學(xué)單片機的時候用過,完全可行的。

          #include
          #define uchar unsigned char
          #define uint unsigned int
          sbit lcden=P3^7;
          sbit led=P3^6;
          sbit lcdrs=P3^5;
          uchar num;
          uchar code table[]="I LIKE MCU!";

          本文引用地址:http://www.ex-cimer.com/article/201611/320415.htm

          void delay(uint i)
          {
          uchar j;
          for(;i>0;i--)
          for(j=110;j>0;j--);
          }

          void write_1602com(uchar com)
          {
          lcdrs=0;
          P0=com; //數(shù)據(jù)口
          delay(5);
          lcden=1;
          delay(5);
          lcden=0;
          }

          void write_1602(uchar date)
          {
          lcdrs=1;
          P0=date; //數(shù)據(jù)口
          delay(5);
          lcden=1;
          delay(5);
          lcden=0;
          }

          void init_1602()
          {
          lcden=0;
          write_1602com(0x38);
          write_1602com(0x0e);
          write_1602com(0x06);
          write_1602com(0x01);
          write_1602com(0x80+0x10);
          }

          void main()
          {
          init_1602();
          for(num=0;num<11;num++)
          {
          write_1602(table[num]);
          delay(20);
          }
          while(1);
          }



          關(guān)鍵詞: 1602液晶顯示C語言編

          評論


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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();