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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 數(shù)碼管和流水燈同時(shí)工作

          數(shù)碼管和流水燈同時(shí)工作

          作者: 時(shí)間:2012-08-24 來源:網(wǎng)絡(luò) 收藏
          #includereg52.h>#define uint unsigned int#define uchar unsigned charuchar code temp[]={0x80,0xe3,0x44,0x41,0x23,0x11,0x10,0xc3,0x00,0x01};
          //由0~9的顯示char code b[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xbf,
          0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x01,0x03,0x07,0x0f,0x1f,
          0x3f,0x7f,0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};//先是逐個(gè)閃動(dòng),
          后反向閃動(dòng),再全部閃動(dòng),再反向全部閃動(dòng)。void delay(uint time)//{while(time--);}void main() //主函數(shù){uint k,l;uchar i,j;j=0;while(1){for(i=0;i10;i++){P1=temp;P2=b[j]; for(l=0;l100;l++)for(k=0;k5;k++)delay(10);j++;if(j==38)j=0;}}}缺點(diǎn):?jiǎn)纹瑱C(jī)兩個(gè)IO口不能同時(shí)獨(dú)立工作!  


          評(píng)論


          相關(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); })();