AIServoOffset.save()

[AIServo86]

説明

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

Syntax

servooffset.save(filename)

Parameters

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.

Returns

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

コメントする

上部へスクロール