servoMultiResume()

[Servo86]

描述

Resume the motion of several suspended servos at the same time, so that the servos can continue to rotate to the target position. (This function acts like calling resume() for each specified servo.)

語法

servoMultiResume()
servoMultiResume(servo1)
servoMultiResume(servo1, servo2)
servoMultiResume(servo1, servo2, ... , servo45)

參數

  • servo1 ~ servo45: Variable of Servo type.

You can enter 1 to 45 servo type parameters to specify the servos to be restored together. You can also enter no parameters, and when no parameters are entered, it means to restore the motion of all the suspended servos.

回傳

None

範例

#include <Servo86.h>
 
Servo servo0;
Servo servo1;
 
void setup()
{
   servo0.attach(6); servo1.attach(10);
   servo0.setPosition(1500);
   servo1.setPosition(1600);
   servoMultiRun(servo0, servo1); // turn servo0 and servo1 to the initial position together
}
 
void loop()
{
   servo0.setPosition(900, 2000);
   servo1.setPosition(2000, 2000);
   servoMultiRun(servo0, servo1); // make servo0, servo1 rotate to the new target position
   delay(1000);
   servoMultiPause(servo0, servo1); // Pause all servos
   delay(3000); // pause for 3 seconds
   servoMultiResume(servo0, servo1); // all servos resume rotation
   while(isServoMultiMoving() == true); // wait for all servos to go to the target position
   servo0.setPosition(1500, 2000);
   servo1.setPosition(1600, 2000);
   servoMultiRun(servo0, servo1); // make servo0, servo1 rotate to the new target position
   while(isServoMultiMoving() == true); // wait for all servos to go to the target position
}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール