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).

Syntax

servoframe.load(filename)

Parameters

  • 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.

Returns

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

Example

#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() {}

See also


Libraries Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

コメントする

上部へスクロール