ServoOffsetVstone builder

[Servo86]

説明

Initializes the ServoOffsetVstone class.

ServoOffsetVstone is inherited from the ServoOffset category and can load offset fine tuning values from the action profile generated by the RobovieMaker2 action editor.

Syntax

ServoOffsetVstone myoffset
ServoOffsetVstone myoffset(filename, offset_name)

Parameters

  • filename: The name of the .ini action profile generated by RobovieMaker2.
  • offset_name: The name of the offset trim value (Offset) in the RobovieMaker2 action profile (available in RobovieMaker2).

If these two parameters are entered, ServoOffsetVstone will automatically load the offset trim value from the file as the initial value when the class is initialized. Note that you must place the file in the root directory of the SD card; if your 86Duino is not placed on the SD card, or if the SD card does not contain an action file, the file loading will fail.

Example

#include <Servo86.h>
 
Servo myservo1;
Servo myservo2;
Servo myservo3;
 
// Load the offset trim value named Offset 0 from the vstone_offset.ini profile in the SD card
ServoOffsetVstone myoffset("vstone_offset.ini", "Offset 0");
 
void setup()
{
   myservo1.attach(21);
   myservo2.attach(23);
   myservo3.attach(25);
 
   // Set the compensation amount of the center position error of each servo
   myoffset.setOffsets(myservo1, myservo2, myservo3);
  
   myservo1.setPosition(1000);
   myservo2.setPosition(1500);
   myservo3.setPosition(2000);
   servoMultiRun(); // Rotate each servo (will automatically compensate for servo center position error)
}
 
void loop() {}

See also


Libraries Reference Home

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

コメントする

上部へスクロール