aiservoEndSplineMotion()

Description

Disables the curve interpolation function enabled by aiservoBeginSplineMotion(). This function is supported starting with Coding 315.

Grammar

aiservoEndSplineMotion()

Parameters

None

Postback

None

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

#include "AIServo86.h"

AIServo Servo1;

AIServo Servo2;

AIServo Servo3;

AIServoPort(ROBOTIS, AX12) bus;

AIServoFrame Frames[3];

unsigned long playtime[3] = {500, 800, 300};

void setup() {

  Servo1.attach(bus, 21); Servo2.attach(bus, 22); Servo3.attach(bus, 23);

  Frames[0].positions[0] = 150; Frames[0].positions[1] = 150; Frames[0].positions[2] = 130;

  Frames[1].positions[0] = 240; Frames[1].positions[1] = 145; Frames[1].positions[2] = 180;

  Frames[2].positions[0] = 240; Frames[2].positions[1] = 160; Frames[2].positions[2] = 180;

  Serial.println("Natural CUBIC");

}

 

void loop() {

  aiservoBeginSplineMotion(NATURAL_CUBIC, Frames, playtime, 3);

  for (int i=0; i<3; i++) {

    Frames[i].playPositions(playtime[i]);

    while(isAIServoMultiMoving() == true);

  }

  aiservoEndSplineMotion();

}

See also

– attach()
– AIServoFrame
– positions[]
– playPositions()
– isAIServoMultiMoving()
– aiservoBeginSplineMotion()

 


 

Library Reference Page

The text in the 86Duino reference material is licensed under the Creative Commons Attribution-Share Alike 3.0 License. The code examples in the reference material have been released into the public domain.