ServoFramePololu constructor
描述
初始化 ServoFramePololu 类别。
ServoFramePololu 是继承自 ServoFrame 类别,能载入用 Pololu 动作编辑器 Maestro Control Center 制作的机器人动作帧。
语法
ServoFramePololu myframe
ServoFramePololu myframe(filename, sequence_name, frame_name)
参数
filename:由 Maestro Control Center 所储存的动作帧档案名称。
sequence_name:动作帧所属的 Sequence 名称(可在 Maestro Control Center 中查询取得)。
frame_name:动作帧的名称(可在 Maestro Control Center 中查询取得)。
如果有输入以上三个参数,则 ServoFramePololu 在初始化类别时,会自动载入该档案内的指定动作帧做为初始动作帧。请注意,您必须将档案放在 SD 卡根目录下;假如您的 86Duino 没有置入 SD 卡,或者 SD 卡内不包含动作帧档案,则档案载入会失败。
范例
#include <Servo86.h>
Servo myservo0;
Servo myservo1;
Servo myservo2;
// 载入 Pololu 动作帧档中 "Sequence 0" 的 "Frame 0"
ServoFramePololu myframe("mypololu.txt", "Sequence 0", "Frame 0");
void setup()
{
myservo0.attach(21);
myservo1.attach(23);
myservo2.attach(25);
myframe.playPositions(myservo0, myservo1, myservo2); // 播放动作帧
}
void loop() {}
See also
- load()
- setPostions()
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.
