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

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 51單片機(jī)——靜態(tài)數(shù)碼管流動(dòng)顯示

          51單片機(jī)——靜態(tài)數(shù)碼管流動(dòng)顯示

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

          共陰極數(shù)碼管碼表:

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

          0x3f , 0x06 , 0x5b , 0x4f ,0x66 , 0x6d ,

          0 1 2 3 4 5

          0x7d , 0x07 , 0x7f , 0x6f , 0x77 , 0x7c ,

          6 7 8 9 A B

          0x39 , 0x5e , 0x79 , 0x71 , 0x00

          C D E F 無(wú)顯示

          實(shí)際應(yīng)用中,定義一個(gè)數(shù)組即可:

          ?unsigned charcodeDIG_CODE[17]={0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71,0x00};

          ?

          #include?< reg51.h >

          void delay_10_ms(unsigned char t);//聲明延時(shí)函數(shù)

          unsigned char code digit_code[17]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71,0x00};

          void main(void)

          {

          unsigned char i;

          P0=0x00; //起始點(diǎn)亮全管

          delay_10_ms(100); //延時(shí)1s

          for(i=0;i<17;i++)

          {

          P0=~digit_code[i];//取反點(diǎn)亮

          delay_10_ms(100);

          }

          }

          void delay_10_ms(unsigned char t)//10ms延時(shí)程序

          {

          unsigned char i,j;

          for(;t>0;t--)

          for(i=38;i>0;i--)

          for(j=130;j>0;j--);

          }

          參考鏈接:

          http://www.21ic.com/jichuzhishi/mcu/program/2013-05-22/182240_2.html?

          http://www.cnblogs.com/zhliao/archive/2012/05/22/2513886.html



          評(píng)論


          技術(shù)專(zhuān)區(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); })();