[AIServo86]
説明
Set the offset angle of the servo.
This function can be used to fine-tune the angle of the servo after initialization. Once the offset value is set, the library will automatically add the offset value to calculate the actual target angle when calculating the target angle of the servo in the future.
構文
servo.setOffset(value)
媒介変数
servo: the variable of AIServo type.value: the offset in floating point, unit: degree.
戻り値
なし
例
#include <AIServo86.h>
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;
void setup()
{
bus.begin(Serial1, 1000000);
myservo. attach(bus, 9);
myservo.setOffset(-5); // Set the trim angle of -5 degrees
myservo.write(150); // turn the servo to 150 degrees (actually 150 - 5 = 145)
}
void loop() {}参照
ライブラリリファレンスホーム
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。