Syntax
void writeMicroseconds(
    int value
);
ContentsIndex
PreviousUpNext
Servo::writeMicroseconds Method
Servo Class | Example
Syntax
void writeMicroseconds(
    int value
);
Description

Writes a value to servo to control the corresponding lever. Sets up the rotation angle of a standard servo motor. In terms of parameters for a standard servo: 1000 means rotating counterclockwise in full speed. 2000 means clockwise in full speed. 1500 means in the middle. 

The following is extracted from Arduino's official website: For customers who do not operate following the standard method, for example by setting the response value of servo between 700 and 2300, in attempt to enlarge the limits to adjust the range of rotation. However, such operation may shorten the life of a servo and should be avoided.

Parameters
Parameters 
Description 
int value 
The value of time in microseconds. 
Returns

Void.

Example
#include <Servo.h>
 
Servo myservo;
 
void setup()
{
  myservo.attach(9);
  myservo.writeMicroseconds(1500);  // Sets the servo to mid-point.
}
 
void loop() 
{
  
}
File

Servo.h

Class