Index
 
  The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
Name  

Servo

   
Examples  
#include <Servo.h> 
 
Servo myservo; 
Servo mysecondservo; 
 
void setup() { 
  myservo.attach(3) // attaches a servo connected to pin 3 
  mysecondservo.attach(15) // attaches a servo connected to pin 15 
} 
 
void loop() { 
  myservo.write(180);      // sets the servo position at 180 degrees 
  mysecondservo.write(65); // sets the servo position at 65 degrees 
} 


#include <Servo.h> 
 
Servo myservo; 
 
void setup() { 
  myservo.attach(2)  // attaches a servo connected to pin 2 
} 
 
void loop() { 
  myservo.write(90);  // position the servo angle at 90 degrees 
} 

Description   Class for controlling servo motors connected to the Wiring I/O pins.
   
Syntax  
Servo myservo;
   
Parameters  
 

   
Methods  
attach()
 

detach()
 

read()
 

write()
 

attached()
 

   
Returns   None
   
Usage   Application