Advertisement
vosc3112

Using a Servo Motor (Single)

Apr 7th, 2020
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Servo Rotation (Single)
  2.  * 4/7/20
  3.  */
  4.  
  5. #include <Servo.h>
  6.  
  7. Servo servoMotor;
  8.  
  9. void setup() {
  10.  
  11. servoMotor.attach (9); //Attach which pin the motor uses
  12.  
  13. }
  14.  
  15. void loop() {
  16.  
  17. //Turn the motor 180 degrees
  18. servoMotor.write(0);
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement