日本a√视频在线,久久青青亚洲国产,亚洲一区欧美二区,免费g片在线观看网站

        <style id="k3y6c"><u id="k3y6c"></u></style>
        <s id="k3y6c"></s>
        <mark id="k3y6c"></mark>
          
          

          <mark id="k3y6c"></mark>

          新聞中心

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

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

          作者: 時(shí)間:2016-11-18 來源:網(wǎng)絡(luò) 收藏
          //===========================================================
          // 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!=