Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. #pragma config(Sensor, dgtl1, rightQuad, sensorQuadEncoder)
  2. #pragma config(Sensor, dgtl3, leftQuad, sensorQuadEncoder)
  3. #pragma config(Motor, port1, intake1, tmotorVex393_HBridge, openLoop)
  4. #pragma config(Motor, port2, rightFrontDrive, tmotorVex393_MC29, openLoop, reversed)
  5. #pragma config(Motor, port3, leftFrontDrive, tmotorVex393_MC29, openLoop)
  6. #pragma config(Motor, port4, rightBackDrive, tmotorVex393_MC29, openLoop, reversed)
  7. #pragma config(Motor, port5, leftBackDrive, tmotorVex393_MC29, openLoop)
  8. #pragma config(Motor, port6, winch1, tmotorVex393_MC29, openLoop)
  9. #pragma config(Motor, port7, winch2, tmotorVex393_MC29, openLoop)
  10. #pragma config(Motor, port8, winch3, tmotorVex393_MC29, openLoop)
  11. #pragma config(Motor, port9, winch4, tmotorVex393_MC29, openLoop)
  12. #pragma config(Motor, port10, intake2, tmotorVex393_HBridge, openLoop)
  13. //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
  14.  
  15. #pragma platform(VEX)
  16.  
  17. //Competition Control and Duration Settings
  18. #pragma competitionControl(Competition)
  19. #pragma autonomousDuration(20)
  20. #pragma userControlDuration(120)
  21.  
  22. #include "Vex_Competition_Includes.c" //Main competition background code...do not modify!
  23.  
  24.  
  25. // Courtesy of Jacob from team 2158S ausTIN CANs - Overclocked.
  26.  
  27. //For Jacob of 69.
  28.  
  29. /////////////////////////////////////////////////////////////////////////////////////////
  30. //
  31. // Pre-Autonomous Functions
  32. //
  33. // You may want to perform some actions before the competition starts. Do them in the
  34. // following function.
  35. //
  36. /////////////////////////////////////////////////////////////////////////////////////////
  37.  
  38. void pre_auton()
  39. {
  40. // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
  41. // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
  42. bStopTasksBetweenModes = true;
  43.  
  44. // All activities that occur before the competition starts
  45. // Example: clearing encoders, setting servo positions, ...
  46. }
  47.  
  48. /////////////////////////////////////////////////////////////////////////////////////////
  49. //
  50. // Autonomous Task
  51. //
  52. // This task is used to control your robot during the autonomous phase of a VEX Competition.
  53. // You must modify the code to add your own robot specific commands here.
  54. //
  55. /////////////////////////////////////////////////////////////////////////////////////////
  56.  
  57. task autonomous()
  58. {
  59.  
  60. //For auto you just need to figure out how many encoder ticks are in one rotation of your wheel.
  61.  
  62. //example
  63.  
  64.  
  65.  
  66. // .....................................................................................
  67. // Insert user code here.
  68. // .....................................................................................
  69.  
  70. AutonomousCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
  71. }
  72.  
  73. /////////////////////////////////////////////////////////////////////////////////////////
  74. //
  75. // User Control Task
  76. //
  77. // This task is used to control your robot during the user control phase of a VEX Competition.
  78. // You must modify the code to add your own robot specific commands here.
  79. //
  80. /////////////////////////////////////////////////////////////////////////////////////////
  81.  
  82. task usercontrol()
  83. {
  84. // User control code here, inside the loop
  85.  
  86. while (true)
  87. {
  88. // This is the main execution loop for the user control program. Each time through the loop
  89. // your program should update motor + servo values based on feedback from the joysticks.
  90.  
  91. // .....................................................................................
  92. // Insert user code here. This is where you use the joystick values to update your motors, etc.
  93. // .....................................................................................
  94.  
  95. motor[rightFrontDrive] = vexRT [Ch2];
  96. motor[leftFrontDrive] = vexRT [Ch3];
  97. motor[rightBackDrive] = vexRT [Ch2];
  98. motor[leftBackDrive] = vexRT [Ch2];
  99. UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement