Advertisement
Guest User

Untitled

a guest
May 31st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. #pragma config(Sensor, dgtl4, bttn, sensorTouch)
  2. #pragma config(Motor, port3, leftMotor, tmotorVex393_MC29, openLoop)
  3. #pragma config(Motor, port5, rightMotor, tmotorVex393_MC29, openLoop)
  4. #pragma config(Motor, port8, armMotor, tmotorVex393_MC29, openLoop)
  5.  
  6. //+++++++++++++++++++++++++++++++++++++++++++++| MAIN |+++++++++++++++++++++++++++++++++++++++++++++++
  7.  
  8. task main()
  9. {
  10. while(1 == 1)
  11. {
  12. //Driving Motor Control
  13. motor[leftMotor] = vexRT[Ch3] / 2;
  14. motor[rightMotor] = vexRT[Ch2] / 2;
  15.  
  16. //Arm Control
  17. if(vexRT[Btn6U] == 1)
  18. {
  19. motor[armMotor] = 40;
  20. }
  21. else if(vexRT[Btn6D] == 1)
  22. {
  23. motor[armMotor] = -40;
  24. }
  25. else
  26. {
  27. motor[armMotor] = 0;
  28. }
  29.  
  30. if (SensorValue [bttn] == 1)
  31. {
  32. motor[leftMotor] = 40; // Start of run 1
  33. motor[rightMotor] = 55;
  34. wait1Msec(3000);
  35. motor[leftMotor] = 0;
  36. motor[rightMotor] = 0;
  37. motor[armMotor] = -40;
  38. wait1Msec(500);
  39. motor[armMotor] = 0;
  40. wait1Msec(1000);
  41. motor[armMotor] = 40;
  42. wait1Msec(300);
  43. motor[armMotor] = 0;
  44. motor[leftMotor] = -40;
  45. motor[rightMotor] = -40;
  46. wait1Msec (3000);
  47. motor[leftMotor] = 0;
  48. motor[rightMotor] = 0;
  49. wait1Msec (3000); // End of run 1
  50. motor[rightMotor] = 40;
  51. wait1Msec (500);
  52. motor[rightMotor] = 0;
  53. wait1Msec (1000);
  54. motor[leftMotor] = 40; // Start of run 2
  55. motor[rightMotor] = 55;
  56. wait1Msec(3000);
  57. motor[leftMotor] = 0;
  58. motor[rightMotor] = 0;
  59. motor[armMotor] = -40;
  60. wait1Msec(500);
  61. motor[armMotor] = 0;
  62. wait1Msec(1000);
  63. motor[armMotor] = 40;
  64. wait1Msec(300);
  65. motor[armMotor] = 0;
  66. motor[leftMotor] = -40;
  67. motor[rightMotor] = -40;
  68. wait1Msec (3000);
  69. motor[leftMotor] = 0;
  70. motor[rightMotor] = 0; // End of run 2
  71. }
  72.  
  73. }
  74.  
  75.  
  76. }
  77.  
  78. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement