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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)C語言程序設(shè)計(jì): 單片機(jī)與 PC 通信

          單片機(jī)C語言程序設(shè)計(jì): 單片機(jī)與 PC 通信

          作者: 時(shí)間:2013-10-29 來源:網(wǎng)絡(luò) 收藏

          //串口接收中斷函數(shù)

          void Serial_INT() interrupt 4

          {

          uchar c;

          if(RI==0) return; //關(guān)閉串口中斷

          ES=0; //清接收中斷標(biāo)志

          RI=0;

          c=SBUF;

          if(c>='0'c='9')

          { //緩存新接收的每個字符,并在其后放-1 為結(jié)束標(biāo)志

          Receive_Buffer[Buf_Index]=c-'0';

          Receive_Buffer[Buf_Index+1]=-1;

          Buf_Index=(Buf_Index+1)%100;

          }

          ES=1;

          }

          void EX_INT0() interrupt 0 //外部中斷 0

          {

          uchar *s="這是由 8051 發(fā)送的字符串!rn";

          uchar i=0;

          while(s[i]!='')

          {

          SBUF=s[i];

          while(TI==0);

          TI=0;

          i++;

          }

          }

          單片機(jī)C語言程序設(shè)計(jì): 單片機(jī)與 PC 通信


          上一頁 1 2 下一頁

          評論


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