AIServoFrame.load()

[AIServo86]

描述

Load user-defined robot action frames from the specified file (i.e. save the action frames in the file to the positions[] array).

語法

servoframe.load(filename)

參數

  • servofame: Variable of the AIServoFrame type.
  • filename: the name of the file. Please note that currently only the root directory of the SD card is supported for downloading files. If your 86Duino does not have an SD card on it, or if the SD card does not contain the specified files, loading will fail.

回傳

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

範例

#include <AIServo86.h>
  
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo1;
AIServo myservo2;
AIServo myservo3;
AIServoFrame myframe;
  
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo1. attach(bus, 9);
   myservo2. attach(bus, 11);
   myservo3. attach(bus, 5);
   myframe.load("frm0.txt"); // Load the robot action frame from the specified file
   myframe.playPositions(500, myservo1, myservo2, myservo3); // play this Frame for 500 ms
}
  
void loop() {}

參考


函式庫參考主頁面

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

發表評論

上部へスクロール