ServoOffsetKondo Builder

[Servo86]

描述

Initialize the ServoOffsetKondo class.

ServoOffsetKondo is inherited from the ServoOffset class and can be loaded in the action file generated by the Kondo action editor HTH3 (HeartToHeart 3) to fine tune the offsets.

語法

ServoOffsetKondo myoffset
ServoOffsetKondo myoffset(filename)

參數

  • filename: The name of the .rcb action file saved by HTH3.

If the above parameters are entered, ServoOffsetKondo will automatically load the offset trim value from the file as the initial value when initializing the class. 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.

範例

#include <Servo86.h>
 
Servo myservo1;
Servo myservo2;
Servo myservo3;
 
// Load the servo offset fine-tuning value from the kondo.rcb action file in the SD card
ServoOffsetKondo myoffset("kondo.rcb");
 
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() {}

參考


函式庫參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール