Guest User

Untitled

a guest
Dec 16th, 2013
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2.  
  3. Servo myservol;
  4. Servo myservor;
  5. Servo myservom;
  6.  
  7. void setup()
  8. {
  9. myservol.attach(10); // attaches the servo on pin 9 to the servo object
  10. myservor.attach(9); // attaches the servo on pin 9 to the servo object
  11. myservom.attach(5); // center srvo on pin 8
  12. }
  13.  
  14. void loop()
  15. {
  16.  
  17. myservol.write(90); //1 stop
  18. myservor.write(90);
  19. myservom.write(0);
  20. delay(259);
  21. myservol.write(85); //1 forward
  22. myservor.write(95);
  23. myservom.write(0);
  24. delay(250);
  25. myservol.write(90); //1 stop
  26. myservor.write(90);
  27. myservom.write(0);
  28. delay(250);
  29. myservol.write(85); //1 turn
  30. myservor.write(85);
  31. myservom.write(0);
  32. delay(250);
  33. myservol.write(85); //1 forward
  34. myservor.write(95);
  35. myservom.write(0);
  36. delay(250);
  37. myservol.write(90); //2 stop
  38. myservor.write(90);
  39. myservom.write(90);
  40. delay(250);
  41. myservol.write(85); //2 forward
  42. myservor.write(95);
  43. myservom.write(90);
  44. delay(250);
  45. myservol.write(90); //1 2 stop
  46. myservor.write(90);
  47. myservom.write(90);
  48. delay(250);
  49. myservol.write(85); //1 2 turn
  50. myservor.write(85);
  51. myservom.write(90);
  52. delay(250);
  53. myservol.write(85); //1 2 forward
  54. myservor.write(95);
  55. myservom.write(90);
  56. delay(250);
  57. }
RAW Paste Data