サイト内検索

検索

Shares

Table of Content

Servo86.attach()

[Servo86]

説明

Assign the Servo object to one of the output pins. When this function is called, the voltage on the specified pin will be initialized to LOW.

構文

servo86.attach(pin)
servo86.attach(pin, min, max)

媒介変数

  • servo: Servo type of the variable.
  • pin: Pin number.
  • min (optional): The minimum PWM pulse width in microseconds (us). If there is no input value or the input value is less than 450, the default value of 450 us will be used internally as the minimum PWM width.
  • max (optional): The maximum PWM pulse width in microseconds (us). If there is no input value or the input value is greater than 2800, the default value of 2800 us will be used as the maximum PWM width.

戻り値

なし

#include <Servo86.h> 
 
Servo myservo;
 
void setup() 
{ 
  myservo.attach(9); // Initialize pin 9 as Servo pin
} 
 
void loop() {} 

See also


Libraries Reference Home

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

上部へスクロール