ServoFrameInno 建构子
描述
初始化 ServoFrameInno 类别。
ServoFrameInno 是继承自 ServoFrame 类别,能载入用 Innovati 动作编辑器制作的机器人动作帧。
语法
ServoFrameInno myframe
ServoFrameInno myframe(filename)
参数
filename
:Innovati 动作编辑器所储存的动作帧档案名称。
如果有输入上面档名参数,则 ServoFrameInno 在初始化类别时,会自动载入该档案做为初始动作帧。请注意,您必须将档案放在 SD 卡根目录下;假如您的 86Duino 没有置入 SD 卡,或者 SD 卡内不包含动作帧档案,则档案载入会失败。
范例
#include <Servo86.h> Servo myservo0; Servo myservo1; Servo myservo2; // 从 SD 卡中载入 Frame0.ftxt 动作帧档案 ServoFrameInno myframe("Frame0.ftxt"); void setup() { myservo0.attach(21); myservo1.attach(23); myservo2.attach(25); myframe.playPositions(myservo0, myservo1, myservo2); // 播放动作帧 } void loop() {}
See also
- load()
- setPositions()
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.