aiservoEndSplineMotion()
描述
關閉由 aiservoBeginSplineMotion() 開啟的曲線插補功能。此功能在 Coding 315 以後開始支援。
語法
aiservoEndSplineMotion()
參數
無
回傳
無
範例
#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()
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.