サイト内検索

検索

Shares

Table of Content

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

構文

servooffset.load(filename)

媒介変数

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.

戻り値

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

#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下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

上部へスクロール