load()
描述
载入 Maestro Control Center 动作帧档案里指定的动作帧。
语法
myframe.load(filename, sequence_name, frame_name)
参数
myframe:ServoFramePololu 型别的物件。
filename:由 Maestro Control Center 所储存的动作帧档案名称。注意:此函式只会到 SD 卡的根目录下寻找动作帧档案,假如您的 86Duino 没有插入 SD 卡,或者 SD 卡中没有指定档案,则载入会失败。
sequence_name:动作帧所属的 Sequence 名称(可在 Maestro Control Center 中查询取得)。
frame_name:动作帧的名称(可在 Maestro Control Center 中查询取得)。
回传
true:档案载入成功。
false:档案载入失败。
范例
#include <Servo86.h>
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoFramePololu myframe;
void setup()
{
myservo0.attach(9);
myservo1.attach(11);
myservo2.attach(5);
// 载入 Pololu 动作帧档中 "Sequence 0" 的 "Frame 0"
myframe.load(“pololu.txt", "Sequence 0", "Frame 0");
myframe.playPositions(myservo0, myservo1, myservo2); // 播放动作帧
}
void loop() {}
See also
- positions[]
- setPostions()
- save()
The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
