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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 單片機C語言程序設計:8 只數(shù)碼管滾動顯示數(shù)字、字符

          單片機C語言程序設計:8 只數(shù)碼管滾動顯示數(shù)字、字符

          作者: 時間:2013-06-06 來源:網絡 收藏

          單片機C語言程序設計:8 只數(shù)碼管滾動顯示數(shù)字、字符

          /* 名稱:8 只數(shù)碼管滾動顯示單個數(shù)字

          說明:數(shù)碼管從左到右依次滾動顯示

          0~7,程序通過每次僅循環(huán)選通一只數(shù)碼

          */

          #includereg51.h>

          #includeintrins.h>

          #define uchar unsigned char

          #define uint unsigned int

          uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};

          //延時

          void DelayMS(uint x)

          {

          uchar t;

          while(x--) for(t=0;t120;t++);

          }

          //主程序

          void main()

          {

          }

          uchar i,wei=0x80;

          while(1)

          {

          for(i=0;i8;i++)

          {

          P2=0xff; //關閉顯示

          wei=_crol_(wei,1);

          P0=DSY_CODE[i];發(fā)送數(shù)字段碼

          P2=wei; //發(fā)送位碼

          DelayMS(300);

          }

          }

          /* 名稱:8 只數(shù)碼管動態(tài)顯示多個不同字符

          說明:數(shù)碼管動態(tài)掃描顯示 0~7。

          */

          #includereg51.h>

          #includeintrins.h>

          #define uchar unsigned char

          #define uint unsigned int

          uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};

          c語言相關文章:c語言教程



          上一頁 1 2 3 下一頁

          評論


          相關推薦

          技術專區(qū)

          關閉
          看屁屁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); })();