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

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)流水燈實(shí)驗(yàn)程序

          單片機(jī)流水燈實(shí)驗(yàn)程序

          作者: 時(shí)間:2016-11-30 來(lái)源:網(wǎng)絡(luò) 收藏
          流水燈是很多初學(xué)者學(xué)習(xí)的一個(gè)程序,可以這么說(shuō)是一個(gè)必學(xué)程序,舉個(gè)很簡(jiǎn)單的它的應(yīng)用,很多生產(chǎn)線都需要用到左移,右移的操作,也許流水燈的程序就是最簡(jiǎn)單的,也稱得上比較經(jīng)典的例子吧。

          程序:#include
          #include
          #define uni unsigned int
          #define unc unsigned char
          void delay(int);
          unc tems;
          void main()
          {
          tems = 0xfe;
          P1 = tems;//給P1口賦值
          while(1)
          {
          tems = _cror_(tems,1);//移位操?
          delay(300);
          P1 = tems;
          }
          }
          void delay(int z)//延時(shí)子程序
          {
          uni x,y;
          for(x=z;x>0;x--)
          for(y=500;y>0;y--);
          }

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


          評(píng)論


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