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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 單片機流水燈三個點亮方向

          單片機流水燈三個點亮方向

          作者: 時間:2012-09-19 來源:網(wǎng)絡 收藏

          二、縱向點亮(點亮次序由P0.0~P1.0~P2.0~P3.0再到P0.1~P1.1以此類推)

          include reg52.h  //此處使用的為89S52的芯片

          void delay(unsigned int second)

          {

              unsigned int i,j;   //定義為unsigned防止負數(shù),習慣問題

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

              {

                  for(j=0;j200000;j++);

              }

          }

          void main(void)

          {

              unsigned i;

              while(1)

              {    

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

                  {

                      P0=0x01i;

                      delay(100);

                      P0=0;

                      P1=0x01i;

                      delay(100);

                      P1=0;

                      P2=0x01i;

                      delay(100);

                      P2=0;

                      P3=0x01i;

                      delay(100);

                      P3=0:

                  }

              }

          }



          關(guān)鍵詞: 方向 三個點亮 流水 單片機

          評論


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