Advertisement
kartonman

How To Test A Micro Server

Sep 14th, 2021
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // Include the Servo library
  2. #include <Servo.h>
  3. // Declare the Servo pin
  4. int servoPin = 3;
  5. // Create a servo object
  6. Servo Servo1;
  7. void setup() {
  8. // We need to attach the servo to the used pin number
  9. Servo1.attach(servoPin);
  10. }
  11. void loop(){
  12. // Make servo go to 0 degrees
  13. Servo1.write(0);
  14. delay(1000);
  15. // Make servo go to 90 degrees
  16. Servo1.write(90);
  17. delay(1000);
  18. // Make servo go to 180 degrees
  19. Servo1.write(180);
  20. delay(1000);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement