サイト内検索

検索

Shares

Table of Content

AIServoOffset.save()

[AIServo86]

説明

Save the offsets (i.e., offsets[] array) of all AIServo’s on the robot to the specified file.

構文

servooffset.save(filename)

媒介変数

servooffset: Variable of type AIServoOffset.

filename: the name of the file. Please note that the file is currently only supported to be saved to the root directory of the SD card. If you do not have an SD card on your 86Duino, saving will fail.

戻り値

  • true: File was saved successfully.
  • false: File saving 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.offsets[0] = -20; // Set Offset content
   myoffset.offsets[1] = 5;
   myoffset.offsets[2] = -10;
   myoffset.save("offset0.txt"); // Save the motion fine-tuning value to "offset0.txt" in the root directory of SD card
}
 
void loop() {}

See also


Libraries Reference Home

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

上部へスクロール