jpglickwebber

Shape 1

Apr 9th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <Servo.h>;
  2.  
  3. void setup() {
  4. Servo servoLeft;
  5. Servo servoRight;
  6.  
  7. servoLeft.attach(12);
  8. servoRight.attach(11);
  9.  
  10. //straight line
  11.  
  12. servoLeft.writeMicroseconds(1700);
  13. servoRight.writeMicroseconds(1380);
  14.  
  15. delay(3000);
  16.  
  17. //turn 90 left
  18.  
  19. servoLeft.writeMicroseconds(1300);
  20. servoRight.writeMicroseconds(1300);
  21.  
  22. delay(500);
  23.  
  24. //arc back to beginning
  25.  
  26. servoLeft.writeMicroseconds(1550);
  27. servoRight.writeMicroseconds(1300);
  28.  
  29. delay(6000);
  30.  
  31. //stop
  32.  
  33. servoLeft.detach();
  34. servoRight.detach();
  35.  
  36. }
  37.  
  38. void loop() {
  39. // put your main code here, to run repeatedly:
  40.  
  41. }
Add Comment
Please, Sign In to add comment