Guest
Public paste!

Stigern

By: a guest | May 3rd, 2009 | Syntax: None | Size: 0.42 KB | Hits: 628 | Expires: Never
Copy text to clipboard
  1. #include <Servo.h>
  2.  
  3. Servo myservo;  // create servo object to control a servo
  4.                 // a maximum of eight servo objects can be created
  5.  
  6. int pos = 0;    // variable to store the servo position
  7.  
  8. void setup()
  9. {
  10.   myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  11. }
  12.  
  13.  
  14. void loop()
  15. {
  16.   myservo.write(90); // Writes position 90, which in this case will be center = stop
  17. }