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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > proteus仿真8位共陰極數(shù)碼管顯示

          proteus仿真8位共陰極數(shù)碼管顯示

          作者: 時(shí)間:2016-11-11 來源:網(wǎng)絡(luò) 收藏

          代碼:

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

          #include
          #define uint unsigned int
          #define uchar unsigned char
          //sbit A=P2^0;
          //sbit B=P2^1;
          //sbit C=P2^2;
          void delay(uchar);

          uchar code table[]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x00};

          //共陰級數(shù)碼管字形代碼表

          void main()
          {
          //uchar i;
          while(1)
          {


          P2=(0X00)&(0X07); //位選
          P0=table[2]; //段選
          delay(1);

          P2=(0X01)&(0X07);
          P0=table[0];
          delay(1);

          P2=(0X02)&(0X07);
          P0=table[0];
          delay(1);

          P2=(0X03)&(0X07);
          P0=table[8];
          delay(1);

          P2=(0X04)&(0X07);
          P0=table[0];
          delay(1);

          P2=(0X05)&(0X07);
          P0=table[8];
          delay(1);

          P2=(0X06)&(0X07);
          P0=table[0];
          delay(1);

          P2=(0X07)&(0X07);
          P0=table[8];
          delay(1);



          }

          }


          void delay(uchar y) //延時(shí)程序
          {
          uchar i;
          uint j;
          for(i=0;i{
          for(j=0;j<100;j++);
          }
          }

          本例顯示結(jié)果為20080808,具體段位可以根據(jù)字碼表選擇。



          評論


          技術(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); })();