ServoFramePololu.load()

[Servo86]

描述

Load the action frame specified in the Maestro Control Center action frame file.

語法

myframe.load(filename, sequence_name, frame_name)

參數

  • myframe: the object of ServoFramePololu type.
  • filename: The name of the action frame file saved by Maestro Control Center. Note: This function will only look for the action frame file under the root directory of the SD card. If your 86Duino is not inserted into the SD card, or if there is no specified file in the SD card, the load will fail.
  • sequence_name: the name of the Sequence to which the action frame belongs (can be obtained by querying in Maestro Control Center).
  • frame_name: the name of the action frame (available in Maestro Control Center).

回傳

  • true: The file was loaded successfully.
  • false: File loading failed.

範例

#include <Servo86.h>
  
Servo myservo0;
Servo myservo1;
Servo myservo2;
ServoFramePololu myframe;
 
void setup()
{
   myservo0.attach(9);
   myservo1.attach(11);
   myservo2.attach(5);
   
   // Load "Frame 0" of "Sequence 0" in the Pololu action frame file
   myframe.load("pololu.txt", "Sequence 0", "Frame 0");
 
   myframe.playPositions(myservo0, myservo1, myservo2); // play action frames
}
  
void loop() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール