daily pastebin goal
44%
SHARE
TWEET

Servo Motor Code

a guest Oct 15th, 2015 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2.  
  3. Servo myservo;  
  4.  
  5. int position = 0;    
  6.  
  7. void setup() {
  8.   myservo.attach(9);  
  9. }
  10.  
  11. void loop() {
  12.   for (position = 0; position <= 180; position += 1) {
  13.     myservo.write(position);            
  14.     delay(15);                      
  15.   }
  16.   for (position = 180; position >= 0; position -= 1) {
  17.     myservo.write(position);              
  18.     delay(15);                      
  19.   }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top