aiservoEndSplineMotion()

描述

关闭由 aiservoBeginSplineMotion() 开启的曲线插补功能。此功能在 Coding 315 以后开始支援。

语法

aiservoEndSplineMotion()

参数

回传

范例

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()

 


 

函式库参考主页面

86Duino 参考资料中的文字采用 知识共享署名-相同方式共享 3.0 授权授权。参考资料中的程式码范例已发布到公共领域。