Advertisement
SallatielFernandes

servo-com-lib

Jul 1st, 2022
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2.  
  3. Servo myservo;  // create servo object to control a servo
  4.  
  5. void setup() {
  6.   myservo.attach(9,900,2300);  // (pin, min, max)
  7. }
  8.  
  9. void loop() {
  10.   myservo.write(0);  // tell servo to go to a particular angle
  11.   delay(1000);
  12.  
  13.   myservo.write(90);              
  14.   delay(500);
  15.  
  16.   myservo.write(135);              
  17.   delay(500);
  18.  
  19.   myservo.write(180);              
  20.   delay(1500);                    
  21. }
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement