I want to find...

Search

Shares

Table of Content

Servo86.writeMicroseconds()

[Servo86]

Description

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.

Syntax

servo.writeMicroseconds(position)

Parameters

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

Returns

None.

Example

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

See also


Libraries Reference Home

The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Leave a Comment

Scroll to Top