[Servo86]
説明
Read the current angle of the servo.
構文
servo.read()
媒介変数
servo: Variable of the servo type.
戻り値
The current angle of the servo (type is double floating point number), if the servo is not yet out, the return value is 0.0. (Unit: degree)
例
#include <Servo86.h>
Servo myservo;
double position;
void setup()
{
myservo.attach(9);
myservo.write(90.0); // Let the servo turn to 90 degrees
delay(100); // Delay 100 ms
position = myservo.read(); // Read the current angle
Serial.println(position);
}
void loop() {} 参照
ライブラリリファレンスホーム
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。