Advertisement
Guest User

Untitled

a guest
Mar 1st, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <Servo.h>
  2.  
  3. Servo myservo; // create servo object to control a servo
  4.  
  5.  
  6. void setup() {
  7. myservo.attach(2); // attaches the servo on GPIO D4 to the servo object
  8. }
  9.  
  10. void loop() {
  11. myservo.write(0); // tell servo to go to position in variable 'pos'
  12. delay(500);
  13. myservo.write(180);
  14. delay(500);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement