[Servo86]
説明
Set the target position of the specified servo to the action frame content stored in the positions[] array, and command the servo to rotate.
After calling playPositions(), your program can go to do other things, and the work of rotating the servo will be executed in the background. If you want to know whether the servo is rotating to the target position, you can call isServoMultiMoving() to check.
構文
myframe.playPositions()
myframe.playPositions(servo0)
myframe.playPositions(servo0, servo1)
myframe.playPositions(servo0, servo1, ... , servo44)
myframe.playPositions(time)
myframe.playPositions(time, servo0)
myframe.playPositions(time, servo0, servo1)
myframe.playPositions(time, servo0, servo1, ... , servo44)
媒介変数
myframe
: the object of ServoFramePololu type.servo0 ~ servo44
(optional): Servo type object; servo0 uses the value of positions[0], servo1 uses the value of positions[1], and so on.time
(optional): Sets the time used for the servo to rotate together to the target position; if this value is not set, or if it is set to 0, the servo will rotate at full speed.
戻り値
なし
例
#include <Servo86.h> Servo myservo0; Servo myservo1; Servo myservo2; ServoFramePololu myframe; // declares a ServoFramePololu object void setup() { myservo0.attach(9); myservo1.attach(11); myservo2.attach(5); myframe.positions[0] = 1800; // set the action frame content myframe.positions[1] = 1300; myframe.positions[2] = 2000; // Command all servos to rotate from the current position to the position specified by myframe in 500ms myframe.playPositions(500, myservo0 , myservo1, myservo2); } void loop() {}
See also
Libraries Reference Home
86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。