[Servo86]
Description
You can disable the curve interpolation function enabled by servoBeginSplineMotion(). 86Duino IDE supports this function from Coding 300 onwards.
Syntax
servoEndSplineMotion()
Parameters
None.
Returns
None.
Example
#include "Servo86.h" Servo Servo1; Servo Servo2; Servo Servo3; ServoFrame Frames[3]; unsigned long playtime[3] = {200, 500, 100}; void setup() { Servo1.attach(21); Servo2.attach(22); Servo3.attach(23); Frames[0].positions[0] = 1500; Frames[0].positions[1] = 1500; Frames[0].positions[2] = 1310; Frames[1].positions[0] = 2040; Frames[1].positions[1] = 1450; Frames[1].positions[2] = 1840; Frames[2].positions[0] = 2040; Frames[2].positions[1] = 1060; Frames[2].positions[2] = 1840; Frames[0].playPositions(playtime[0]); Serial.println("Natural CUBIC"); } void loop() { servoBeginSplineMotion(NATURAL_CUBIC, Frames, playtime, 3); // The actions played below will have the smoothing effect of curve interpolation for (int i=0; i<3; i++) { Frames[i].playPositions(playtime[i]); while(isServoMultiMoving() == true); } servoEndSplineMotion(); // disable curve interpolation }
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.