ServoFrameKondo.playPositions()

[Servo86]

Description

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.

Syntax

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)

Parameters

  • myframe: the object of ServoFrameKondo 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): If this value is not set, or if it is set to 0, the servo will rotate at full speed.

Returns

None.

Example

#include <Servo86.h>
  
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoFrameKondo myframe; // declares a ServoFrameKondo object
  
void setup()
{
   myservo0.attach(9);
   myservo1.attach(11);
   myservo2.attach(5);
 
   myframe.positions[0] = 1800; // set the 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

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top