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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應用 > 非常簡單的8*8LED點陣c51源代碼

          非常簡單的8*8LED點陣c51源代碼

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

          /* 實驗目的:學會點陣動態(tài)掃描方法. */
          /* 實驗現(xiàn)象:點陣光柱先從0-9每隔一定的時間動態(tài)顯示。 */
          /*【版權(quán)】Copyright(C)鐵牛 All Rights Reserved */
          /*【聲明】此程序僅用于學習與參考,引用請注明版權(quán)和作者信息!*/
          /*************************************************************/
          #includereg52.h>
          #includeintrins.h>
          #define uchar unsigned char
          #define uint unsigned int
          uchar code row[] ={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//行掃描數(shù)組row0--row7.硬件定義為P1口。
          uchar code word[][8]={
          {0xC7,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB,0xC7},//硬件定義為P0口。'0'
          {0xEF,0x8F,0xEF,0xEF,0xEF,0xEF,0xEF,0xEF},//硬件定義為P0口。'1'
          {0xC7,0xBB,0xBB,0xF7,0xEF,0xDF,0xBF,0x83},//硬件定義為P0口。'2'
          {0xC7,0xBB,0xFB,0xC7,0xFB,0xFB,0xBB,0xC7},//硬件定義為P0口。'3'
          {0xE7,0xE7,0xD7,0xD7,0xB7,0x83,0xF7,0xF7},//硬件定義為P0口。'4'
          {0x83,0xBF,0xBF,0x87,0xFB,0xFB,0xBB,0xC7},//硬件定義為P0口。'5'
          {0xC7,0xBB,0xBF,0x87,0xBB,0xBB,0xBB,0xC7},//硬件定義為P0口。'6'
          {0x83,0xFB,0xF7,0xF7,0xF7,0xEF,0xEF,0xEF},//硬件定義為P0口。'7'
          {0xC7,0xBB,0xBB,0xC7,0xBB,0xBB,0xBB,0xC7},//硬件定義為P0口。'8'
          {0xC7,0xBB,0xBB,0xBB,0xC3,0xFB,0xBB,0xC7},//硬件定義為P0口。'9'
          };

          void display(uchar);
          void delay(uint x)
          {
          uint a,b;
          for(a=x;a>0;a--)
          for(b=100;b>0;b--);
          }

          void main()
          {
          uint i=1000;
          uchar dis_num;
          dis_num=0;
          while(1)
          {
          for(i=100;i>0;i--)
          {
          if(dis_num==10)
          dis_num=0;
          display(dis_num);
          }
          dis_num++;
          }
          }

          void display(uchar word_num)
          {
          uchar i;
          for(i=0;i8;i++)
          {
          P1=row[i];
          P0=word[word_num][i];
          delay(1);
          P1=0xff;
          P0=0xff;
          }
          }

          51單片機相關(guān)文章:51單片機教程


          led顯示器相關(guān)文章:led顯示器原理




          關(guān)鍵詞: 8*8 8LED點陣 c51源代碼

          評論


          相關(guān)推薦

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