AIServo.write()

[AIServo86]

説明

Set the target angle of the servo and rotate it to the target angle.

Please note that the servo will be activated immediately after calling this function. Please avoid turning the servo vigorously by hand to avoid injury or damage to the servo.

Syntax

servo.write(position)

Parameters

  • servo: Variable of the AIServo type.
  • position: The target angle, enter the value of floating-point number type, for example, 90.0, the target position is “degree” unit, that is, 90 degrees of the servo.

Returns

None.

Example

#include <AIServo86.h>
 
AIServoPort(ROBOTIS, AX12) bus;
AIServo myservo;
 
void setup()
{
   bus.begin(Serial1, 1000000);
   myservo. attach(bus, 9);
   myservo.write(90.0); // turn the servo to 90 degrees
}
 
void loop() {}

See also


Libraries Reference Home

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

コメントする

上部へスクロール