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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 玩轉(zhuǎn)LED點陣之一:16X64單紅點陣靜態(tài)顯示

          玩轉(zhuǎn)LED點陣之一:16X64單紅點陣靜態(tài)顯示

          作者: 時間:2016-11-30 來源:網(wǎng)絡 收藏
          //單片機STC89C52

          //晶振:22.1184M
          //顯示屏:HUB08接口16X64單紅點陣
          //顯示方式:靜態(tài)16X16漢字
          //作者:huqin
          //QQ: 1766135164
          //網(wǎng)址:http://www.51hei.com
          //時間:2013-05-13
          #include
          #include"zimo.h"
          sbit SDAR1=P0^4; //紅色數(shù)據(jù)1
          sbit SDAR2=P3^3; //紅色數(shù)據(jù)2
          sbit SDAG1=P3^4; //綠色數(shù)據(jù)1
          sbit SDAG2=P3^5; //綠色數(shù)據(jù)2
          sbit CLK=P0^7;//74HC595的時鐘
          sbit STB=P0^6;//輸出鎖存
          sbit OE=P0^5;//74HC138的使能

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

          //74HC595串行數(shù)據(jù)輸入
          void SendDate(unsigned char DataR1,unsigned char DataG1,unsigned char DataR2,unsigned char DataG2)
          {
          unsigned char i;
          for(i = 0; i < 8; i++)
          {
          SDAR1=DataR1 & 0x01;
          SDAG1=DataG1 & 0x01;
          SDAR2=DataR2 & 0x01;
          SDAG2=DataG2 & 0x01;
          CLK = 0;
          CLK = 1;
          DataR1 >>= 1;
          DataG1 >>= 1;
          DataR2 >>= 1;
          DataG2 >>= 1;
          }
          }

          //主函數(shù)入口
          void main()
          {
          unsigned int num;
          SDAR1=0;
          SDAR2=0;
          SDAG1=0;
          SDAG2=0;

          while(1)
          {
          for(num=0;num<16;num++)
          {
          SendDate(~Table[num*2+0],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+1],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+0+32],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+1+32],~0X00,~0x00,~0X00);

          SendDate(~Table[num*2+0+64],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+1+64],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+0+96],~0X00,~0x00,~0X00);
          SendDate(~Table[num*2+1+96],~0X00,~0x00,~0X00);
          OE=1;
          STB=1;//輸出鎖存
          STB=0;
          P0=num;//16位行選
          OE=0;
          }
          }
          }

          zimo.h

          unsigned char code Table[]={ //取模宋體
          0x08,0x00,
          0xC8,0x7F,
          0x48,0x00,
          0x7F,0x00,
          0x48,0x3F,
          0x68,0x00,
          0xD8,0x7F,
          0x48,0x03,
          0x4C,0x25,
          0x4B,0x65,
          0x48,0x19,
          0x48,0x11,
          0x28,0x11,
          0x28,0x65,
          0x1A,0x23,
          0x04,0x01,

          0xFC,0x1F,
          0x00,0x0C,
          0x60,0x03,
          0x80,0x00,
          0xFC,0x1F,
          0x84,0x10,
          0x84,0x10,
          0xFC,0x1F,
          0x84,0x10,
          0x84,0x10,
          0xFC,0x1F,
          0x84,0x10,
          0x84,0x10,
          0x84,0x10,
          0x84,0x14,
          0x04,0x08,

          0x80,0x00,
          0x80,0x00,
          0x80,0x00,
          0xFC,0x1F,
          0x84,0x10,
          0x84,0x10,
          0xFC,0x1F,
          0x84,0x10,
          0x84,0x10,
          0x84,0x10,
          0xFC,0x1F,
          0x84,0x10,
          0x80,0x40,
          0x80,0x40,
          0x00,0x7F,
          0x00,0x00,

          0x00,0x00,
          0xFC,0x0F,
          0x00,0x04,
          0x00,0x02,
          0x00,0x01,
          0x80,0x00,
          0x80,0x00,
          0x80,0x20,
          0xFF,0x7F,
          0x80,0x00,
          0x80,0x00,
          0x80,0x00,
          0x80,0x00,
          0x80,0x00,
          0xA0,0x00,
          0x40,0x00,
          };

          實際效果:



          評論


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