AIServoOffset.load()

[AIServo86]

説明

Loads the robot’s AIServos offset from the specified file (i.e., reads the AIServo offset from the file and loads it into the offsets[] array).

Syntax

servooffset.load(filename)

Parameters

servooffset: variable of type AIServoOffset.

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 loading successfully.
  • false: File loading failed.

Example

#include <AIServo86.h>
 
AIServoPort(ROBOTIS, AX12) bus;
 
AIServo myservo0;
AIServo myservo1;
AIServo myservo2;
AIServoOffset myoffset;
 
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo0. attach(bus, 9);
   myservo1. attach(bus, 11);
   myservo2. attach(bus, 5);
   myoffset.load("offset0.txt"); // Load the robot motion trim value from the specified file
   myoffset.setOffsets(myservo0, myservo1, myservo2); // Set the fine-tuning value of the robot motion
}
 
void loop() {}

See also


Libraries Reference Home

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

コメントする

上部へスクロール