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.