Servo::writeMicroseconds()\ Servo \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0024+. 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 | Servo
Name | ### writeMicroseconds()
Examples |
    #include "Servo.h"

    Servo myservo;

    void setup() {
      myservo.attach(2)  // attaches a servo connected to pin 2
    }

    void loop() {
      myservo.writeMicroseconds(544);  // sets the servo position at 0 degrees
    }
    #include "Servo.h"

    Servo myservo;

    void setup() {
      myservo.attach(3) // attaches a servo connected to pin 3
    }

    void loop() {
      myservo.writeMicroseconds(2400);  // sets the servo position at 180 degrees
    }
Description | The writeMicroseconds(ms) method sets Sets the servo pulse width in microseconds.
Syntax |
    servo.writeMicroseconds(ms)
Parameters |
servo | Any variable of type Servo
ms | int: the pulse width in microseconds
Returns | None
Usage | Application

Updated on November 01, 2009 08:33:54am PST