Servo86.writeMicroseconds()

[Servo86]

描述

Set the target angle of the servo, and let the servo rotate 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.

語法

servo.writeMicroseconds(position)

參數

  • servo: the variable of servo type.
  • position: target angle, unit: us.

回傳

範例

#include <Servo86.h> 
 
Servo myservo;
 
void setup() 
{ 
  myservo.attach(9);
  myservo.writeMicroseconds(1500);  // Let the servo turn to the 1500us angle
} 
 
void loop() {} 

參考


函式庫參考主頁面

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

發表評論

上部へスクロール