ServoFrame 建構子
描述
初始化 ServoFrame
類別。
語法
ServoFrame myframe
ServoFrame myframe(filename)
參數
filename
:動作幀檔案名稱。如果有輸入檔案名稱,則 ServoFrame
在初始化類別時,會自動載入該檔案內容做為初始動作幀。請注意,您必須將動作幀檔案放在 SD 卡根目錄下;假如您的 86Duino 沒有置入 SD 卡,或者 SD 卡內不包含動作幀檔案,則檔案載入會失敗。
範例
#include <Servo86.h> Servo myservo1; Servo myservo2; Servo myservo3; ServoFrame myframe("frame.txt"); // 從 SD 卡中載入檔案名稱為 frame.txt 的動作幀 void setup() { myservo1.attach(21); myservo2.attach(23); myservo3.attach(25); myframe.setPositions(); servoMultiRun(); } void loop() {}
See also
- positions[]
- 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.