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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > [C51代碼]廣告燈的循環(huán)移動

          [C51代碼]廣告燈的循環(huán)移動

          作者: 時間:2016-11-10 來源:網(wǎng)絡 收藏
          #include

          /************************************************/
          sbit Key=P2^0;
          static unsigned char p=0;

          本文引用地址:http://www.ex-cimer.com/article/201611/317081.htm
          void delay1ms(unsigned int count)
          {
          int x,y;
          for(x=0;x for(y=0;y<120;y++);
          }
          /************************************************/
          void ScanKey()
          {
          if(Key==0)
          {
          delay1ms(1);
          if(Key==0)
          {
          p++;
          if(p==8) p=0;
          }
          while(Key==0); //按鍵鎖定,每次按鍵只加1
          }
          }
          /************************************************/
          void main()
          {
          unsigned char i;
          unsigned char a,b;
          unsigned char temp=0x0f;
          while(1)
          { ScanKey();
          for(i=0;i<8;i++)
          {
          a=temp< b=temp>>(8-p);
          P0=a|b;
          }
          }
          }


          評論


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