Advertisement
timor2542

[4 DOF Robot Arm Keyestudio][Lab 01][i-Duino UNO R3B] Each +/- 45 Degree Base Servo Control

Aug 2nd, 2021
1,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Servo.h>
  2. Servo myservo1;
  3. int pos1 = 90;
  4. void setup() {
  5.   checkSW();
  6.   myservo1.attach(A1);
  7.   delay(3000);
  8. }
  9.  
  10. void loop() {
  11.   myservo1.write(90);
  12.   delay(3000);
  13.   myservo1.write(45);
  14.   delay(3000);
  15.   myservo1.write(0);
  16.   delay(3000);
  17.   myservo1.write(45);
  18.   delay(3000);
  19.   myservo1.write(90);
  20.   delay(3000);
  21.   myservo1.write(135);
  22.   delay(3000);
  23.   myservo1.write(180);
  24.   delay(3000);
  25.   myservo1.write(135);
  26.   delay(3000);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement