Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma config(Motor, port1, claw, tmotorVex393_HBridge, openLoop)
- #pragma config(Motor, port2, chain, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port3, scissor1, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port4, scissor2, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port5, scissor3, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port6, scissor4, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port7, mobilebase, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port8, backleft, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port9, backright, tmotorVex393_MC29, openLoop)
- //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
- #pragma platform(VEX)
- #pragma competitionControl(Competition)
- #pragma autonomousDuration(15)
- #pragma userControlDuration(120)
- #include "Vex_Competition_Includes.c"
- void scissor(int speed)
- {
- motor[scissor1] = speed;
- motor[scissor2] = speed;
- motor[scissor3] = speed;
- motor[scissor4] = speed;
- }
- void chainbar(int speed)
- {
- motor[chain] = speed;
- }
- void grab(int speed)
- {
- motor[claw] = speed;
- }
- void base(int speed)
- {
- motor[mobilebase] = speed;
- }
- void move(int speed)
- {
- motor[backleft] = speed;
- motor[backright] = speed;
- }
- void pre_auton()
- {
- bStopTasksBetweenModes = true;
- }
- task autonomous()
- {
- }
- task usercontrol()
- {
- // weird controls that should probably be changed
- int X2 = 0, Y1 = 0, X1 = 0, threshold = 15;
- int scissorval = 0;
- int chainbarval = 0;
- int grabval = 0;
- int baseval = 0;
- while(1)
- {
- if(abs(vexRT[Ch3]) > threshold) Y1 = vexRT[Ch3];
- else Y1 = 0;
- if(abs(vexRT[Ch4]) > threshold) X1 = vexRT[Ch4];
- else X1 = 0;
- // if(abs(vexRT[Ch1]) > threshold) X2 = vexRT[Ch1];
- // else X2 = 0;
- motor[backright] = Y1 - X2 + X1;
- motor[backleft] = -Y1 - X2 + X1;
- // if (abs(vexRT[Ch3Xmtr2]) > threshold) scissorval = vexRT[Ch3Xmtr2];
- // else scissorval = 0;
- // scissor(scissorval);
- // if (abs(vexRT[Ch1Xmtr2]) > threshold) grabval = vexRT[Ch1Xmtr2];
- // else grabval = 0;
- // grab(grabval);
- // - - - - - - - - scissor stuff - - - - - - - -
- if ((vexRT[Btn5U]) == true) scissorval = 127;
- else scissorval = 0;
- if ((vexRT[Btn5D]) == true) scissorval = -127;
- else scissorval = 0;
- motor[scissor1] = scissorval;
- motor[scissor2] = scissorval;
- motor[scissor3] = scissorval;
- motor[scissor4] = scissorval;
- // - - - - - - - - chainbar stuff - - - - - - -
- if ((vexRT[Btn6U]) == true) chainbarval = 127;
- else chainbarval = 0;
- if ((vexRT[Btn6D]) == true) chainbarval = -127;
- else chainbarval = 0;
- motor[chain] = chainbarval;
- // - - - - - - - - claw stuff - - - - - - - - -
- if ((vexRT[Btn7D]) == true) grabval = 127;
- else grabval = 0;
- if ((vexRT[Btn7U]) == true) grabval = -127;
- else grabval = 0;
- motor[claw] = grabval;
- // - - - - - - - - base lifty stuff - - - - - -
- if ((vexRT[Btn7L]) == true) baseval = 127;
- else baseval = 0;
- if ((vexRT[Btn7R]) == true) baseval = -127;
- else baseval = 0;
- motor[mobilebase] = baseval;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement