turt2live

Untitled

Feb 17th, 2012
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.10 KB | None | 0 0
  1. #pragma config(Motor,  port2,           rightMotor,    tmotorNormal, openLoop, reversed)
  2. #pragma config(Motor,  port3,           arm,           tmotorNormal, openLoop)
  3. #pragma config(Motor,  port4,           leftMotor,     tmotorNormal, openLoop)
  4. #pragma config(Motor,  port5,           claw,          tmotorNormal, openLoop)
  5. #pragma platform(VEX)
  6. #pragma competitionControl(Competition)
  7. #pragma autonomousDuration(20)
  8. #pragma userControlDuration(120)
  9.  
  10. #include "Vex_Competition_Includes.c"   //Main competition background code
  11. void pre_auton(){
  12.   bStopTasksBetweenModes = true;
  13.  
  14.   while(1 == 1){
  15.     motor[leftMotor]  = vexRT[Ch3];   // Left Joystick Y value
  16.     motor[rightMotor] = vexRT[Ch2];   // Right Joystick Y value
  17.  
  18.     if(vexRT[Btn5U]){
  19.       motor[arm] = 127;
  20.     }else if(vexRT[Btn5D]){
  21.       motor[arm] = -127;
  22.     }else{
  23.       motor[arm] = 0;
  24.     }
  25.  
  26.     if(vexRT[Btn6U]){
  27.       motor[claw] = 127;
  28.     }else if(vexRT[Btn6D]){
  29.       motor[claw] = -127;
  30.     }else {
  31.       motor[claw] = 0;
  32.     }
  33.   }
  34. }
  35.  
  36. task autonomous(){
  37.  
  38. }
  39.  
  40. task usercontrol(){
  41.     while (true){
  42.      
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment