AIServoFrameRobotis.playPositions()

[AIServo86]

Description

Assign the list of target positions representing the Frame to each servo and immediately control the servo to move to the angle specified by the Frame.

Syntax

aiservoframerobotis.playPositions()
aiservoframerobotis.playPositions(servo1)
aiservoframerobotis.playPositions(servo1, servo2)
aiservoframerobotis.playPositions(servo1, servo2, ... , servo64)

aiservoframerobotis.playPositions(time)
aiservoframerobotis.playPositions(time, servo1)
aiservoframerobotis.playPositions(time, servo1, servo2)
aiservoframerobotis.playPositions(time, servo1, servo2, ... , servo64)

Parameters

  • aiservoframerobotis: Variable of AIServoFrameRobotis type.
  • servo1 ~ servo64: The variables of AIServo type.
  • time (optional): If no setting value is entered or the setting value is 0, it means the servo will rotate at full speed.

Returns

None.

Example

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo0;
AIServo myservo1;
AIServo myservo2;
AIServoFrameRobotis myframe; // Declare an AIServoFrameRobotis object
  
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo0. attach(bus, 9);
   myservo1. attach(bus, 11);
   myservo2. attach(bus, 5);
   myframe.positions[0] = 180; // set Frame content
   myframe. positions[1] = 130;
   myframe. positions[2] = 200;
   // Rotate the servo to the position specified by Frame in 500ms (myservo0 rotates to position[0]
   // position, myservo1 rotates to position[1], myservo2 rotates to position[2])
   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