標(biāo)題: 誰能告訴我怎么通過這段程序來調(diào)電機速度 [打印本頁]

作者: h1170460918    時間: 2016-12-16 00:58
標(biāo)題: 誰能告訴我怎么通過這段程序來調(diào)電機速度

/* 電機控制函數(shù) index-電機號(1,2); speed-電機速度(-100100) */

void motor(uchar index, int speed)

{

   if(speed>=-100 && speed<=100)

    {

       if(index==1) /* 電機1的處理 */

        {

           m1=abs(speed); /* 取速度的絕對值 */

           if(speed>0) /* 速度值為正則正轉(zhuǎn) */

            {

               s1=0;






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1