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

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 用定時(shí)器加中斷實(shí)現(xiàn)間隔1S的流水燈C程序

          用定時(shí)器加中斷實(shí)現(xiàn)間隔1S的流水燈C程序

          作者: 時(shí)間:2016-11-13 來(lái)源:網(wǎng)絡(luò) 收藏
          #include

          #include
          #define uchar unsigned char
          #define uint unsigned int
          uchar aa,count,flag;
          void main() //主函數(shù)
          {
          TMOD=0x01;
          TH0=(65536-50000)/256;
          TL0=(65536-50000)%256;
          EA=1;
          ET0=1;
          TR0=1;
          aa=0xfe; //賦初值11111110
          while(1) //大循環(huán)
          {
          P1=aa;
          if(flag==1) //延時(shí)500毫秒
          {
          aa=_crol_(aa,1);//將aa循環(huán)左移1位后再賦給aa
          flag=0;
          }
          }
          }

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

          void timer0() interrupt 1
          {
          TH0=(65536-50000)/256;
          TL0=(65536-50000)%256;
          count++;
          if(count==20)
          {
          count=0;
          flag=1;
          }
          }



          關(guān)鍵詞: 定時(shí)器中斷流水

          評(píng)論


          技術(shù)專(zhuān)區(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); })();