Reference for Wiring 1.0 (ALPHA) 0022+. If you have a previous version, use the reference included with your software.
If you see any errors or have any comments, let us know.
Class
Library
Name
writeMicroseconds()
Examples
#include <Servo.h>
Servo myservo;
void setup() {
myservo.attach(2) // attaches a servo connected to pin 2
}
void loop() {
myservo.write(90); // sets the servo position at 90 degrees
}
#include <Servo.h>
Servo myservo;
void setup() {
myservo.attach(3) // attaches a servo connected to pin 3
}
void loop() {
myservo.write(180); // sets the servo position at 180 degrees
}
Description
The writeMicroseconds(ms) method sets Sets the servo pulse width in microseconds.