Guest User

Helping Hands Operator

a guest
Jul 10th, 2017
156
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //#include <LiquidCrystal_I2C.h>
  2. //#include <Servo.h>
  3. //#include <LCD.h>
  4. //#include <delay.h>
  5. //#include <Wire.h>
  6. #include <ServoEx.h>
  7. ServoEx servo_bdil;
  8. ServoEx servo_arm;
  9. ServoEx servo_joint;
  10. //LiquidCrystal_I2C lcd(12, 11, 5, 4, 3, 2);
  11.  
  12.  
  13. void setup()
  14. {
  15. servo_bdil.attach(3);
  16. servo_arm.attach(10);
  17. servo_joint.attach(11);
  18. //lcd.begin(16, 2);
  19. //lcd.print("hello, world!");
  20.  
  21. /*
  22. servo_bdil.detach();
  23. servo_arm.detach();
  24. servo_joint.detach();
  25. */
  26. }
  27. void loop()
  28. {
  29. Serial.print("Starting");
  30. servo_bdil.write(0);
  31. delay(6000);
  32. servo_arm.write(110);// starts at 110 needs to be here to initialise
  33. delay(1000);
  34. servo_joint.write(120); //initialise
  35. servo_arm.write(110);
  36. delay(3000); //change if needed time miliseconds
  37. servo_arm.write(15);
  38. servo_joint.write(0);
  39. delay(4000);//wait for bdil
  40. //starts at 0
  41. servo_arm.write(15);
  42. servo_bdil.write(60);//place bdil on solder
  43. delay(5000); //place wires
  44. servo_bdil.write(180);
  45. delay(6000);//big dely
  46. servo_arm.write(15);
  47. servo_joint.write(0);
  48. delay(3000);
  49. servo_arm.write(15);
  50. delay(2000);
  51. servo_bdil.write(120);//place bdil on cables
  52. delay(2000);//medium delay
  53. servo_arm.write(110);//back to start
  54. delay(2000);//medium delay
  55. servo_joint.write(120);
  56. delay(1000);//medium delay
  57. for (int i=0; i<4;i++)
  58. {
  59. servo_joint.write(100);
  60. delay(500);
  61. servo_joint.write(120);//X3
  62. delay(500);
  63. }
  64. delay(1000);
  65. servo_joint.write(120);
  66. Serial.print("Ending");
  67. servo_bdil.detach();
  68. servo_arm.detach();
  69. servo_joint.detach();
  70. int j = 1;
  71. while (j>-1)
  72. {
  73. j = j++;
  74. j=j%5;
  75. delay(5000);
  76. }
  77. }
RAW Paste Data