ServoFrameVstone constructor

描述

初始化 ServoFrameVstone 类别。

ServoFrameVstone 是继承自 ServoFrame 类别,能载入用 RobovieMaker2 动作编辑器制作的机器人动作帧。

语法


ServoFrameVstone myframe
ServoFrameVstone myframe(filename, frame_name)

参数

filename:由 RobovieMaker2 所储存 .txt 动作档案名称。

frame_name:动作帧的名称(可在 RobovieMaker2 中查询取得)。

如果有输入以上两个参数,则 ServoFrameVstone 在初始化类别时,会自动载入该档案内的指定动作帧做为初始动作帧。请注意,您必须将档案放在 SD 卡根目录下;假如您的 86Duino 没有置入 SD 卡,或者 SD 卡内不包含动作档案,则档案载入会失败。

范例

#include <Servo86.h> 

Servo myservo0;
Servo myservo1;
Servo myservo2;

// 从 SD 卡中载入 vstone_motion.txt 动作档中的 "Frame 0"
ServoFrameVstone myframe("vstone_motion.txt", "Frame 0");

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.