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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 單片機接收命令發(fā)送脈沖

          單片機接收命令發(fā)送脈沖

          作者: 時間:2016-11-18 來源:網(wǎng)絡 收藏
          //===========================================================
          // step motor 串口通信G代碼
          //
          #include
          #include
          #define uchar unsigned char
          #define uint unsigned int
          #define Gcode_LEN 10 //數(shù)據(jù)長度G01X12345$ (10char)
          sbit Xpul = P0^0; //axis X clk
          sbit Xdir = P0^1; //axis X CCW
          uint Xmove; //cts
          uint Ymove; //cts
          uint Xcount;
          sbit KEY4 = P3^2;
          bit rece_flag = 0; //為1代表串口接收到了一幀數(shù)據(jù)
          uchar receive[Gcode_LEN]={0}; //暫存數(shù)組,可以將10改為需要的數(shù)值
          /**************************************************/
          /* 向串口發(fā)送字符 */
          /**************************************************/
          void send_char_com(uchar c)
          {
          SBUF=c;
          while(TI==0);
          TI=0;
          }
          /**************************************************/
          /* 向串口發(fā)送字符串 */
          /**************************************************/
          void send_string_com(uchar *s)
          {
          while(*s!=看屁屁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); })();