Guest User

Untitled

a guest
Mar 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. #pragma config(Motor, port2, rightMotor, tmotorNormal, openLoop, reversed)
  2. #pragma config(Motor, port3, leftMotor, tmotorNormal, openLoop)
  3. #pragma config(Motor, port6, armMotor, tmotorNormal, openLoop)
  4. //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
  5.  
  6. /*----------------------------------------------------------------------------------------------------*\
  7. |* - Dual Joystick Control with Arm - 1 Remote - *|
  8. |* ROBOTC on VEX 2.0 Cortex *|
  9. |* *|
  10. |* This program uses both the Left and the Right joysticks to run the robot using "tank control". *|
  11. |* The Group 6 buttons on the top-right of the VEXnet Joystick are used to raise and lower an arm. *|
  12. |* *|
  13. |* ROBOT CONFIGURATION *|
  14. |* NOTES: *|
  15. |* 1) Ch1 is the X axis and Ch2 is the Y axis for the RIGHT joystick. *|
  16. |* 2) Ch3 is the Y axis and Ch4 is the X axis for the LEFT joystick. *|
  17. |* *|
  18. |* MOTORS & SENSORS: *|
  19. |* [I/O Port] [Name] [Type] [Description] *|
  20. |* Motor - Port 2 rightMotor VEX Motor Right motor *|
  21. |* Motor - Port 3 leftMotor VEX Motor Left motor *|
  22. |* Motor - Port 6 armMotor VEX Motor Arm motor *|
  23. \*----------------------------------------------------------------------------------------------------*/
  24.  
  25. //+++++++++++++++++++++++++++++++++++++++++++++| MAIN |+++++++++++++++++++++++++++++++++++++++++++++++
  26.  
  27. task main()
  28. {
  29. while(1 == 1)
  30. {
  31. //Driving Motor Control
  32. motor[leftMotor] = vexRT[Ch3] / 2;
  33. motor[rightMotor] = vexRT[Ch2] / 2;
  34.  
  35. //Arm Control
  36. if(vexRT[Btn6U] == 1)
  37. {
  38. motor[armMotor] = 40;
  39. }
  40. else if(vexRT[Btn6D] == 1)
  41. {
  42. motor[armMotor] = -40;
  43. }
  44. else
  45. {
  46. motor[armMotor] = 0;
  47. }
  48. }
  49. }
  50. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Add Comment
Please, Sign In to add comment