Guest User

Untitled

a guest
Apr 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <Servo.h>
  2.  
  3. Servo myservo; // create servo object
  4.  
  5. void setup() {
  6. myservo.attach(10); // attaches the servo on pin 10
  7. myservo.write(50); // moves the servo to 50 degrees
  8. }
  9.  
  10. void loop() {
  11. myservo.write(50); // moves the servo to 50 degrees
  12. delay(1000); // pauses for 1 second
  13. myservo.write(0); // moves the servo to 0 degrees
  14. delay(1000); // pauses for 1 second
  15. myservo.write(50); // moves the servo to 50 degrees
  16. delay(1000); // pauses for 1 second
  17. myservo.write(100); // moves the servo to 100 degrees
  18. delay(1000); // pauses for 1 second
  19. }
Add Comment
Please, Sign In to add comment