Advertisement
Guest User

Stigern

a guest
May 3rd, 2009
1,644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  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. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement