OK, I am trying to put our drive code into a Competition Template so I can use the Competition Switch.
Here is the code we are using now to drive the robot around
#pragma config(Motor, port1, HP393LeftFront, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port2, HP393LeftBack, tmotorVex393, openLoop, reversed)
#pragma config(Motor, port3, IntakeLeft, tmotorVex393, openLoop)
#pragma config(Motor, port4, IntakeRight, tmotorVex393, openLoop)
#pragma config(Motor, port5, StrafingWheelLeft, tmotorVex393, openLoop)
#pragma config(Motor, port6, StrafingWheelRight, tmotorVex393, openLoop)
#pragma config(Motor, port7, LiftRight, tmotorVex393, openLoop)
#pragma config(Motor, port8, LiftLeft, tmotorVex393, openLoop)
#pragma config(Motor, port9, HP393RightFront, tmotorVex393, openLoop)
#pragma config(Motor, port10, HP393RightBack, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
while(1 == 1)
{
motor[HP393LeftFront] = vexRT[Ch2];
motor[HP393LeftBack] = vexRT[Ch2];
motor[HP393RightFront] = vexRT[Ch3];
motor[HP393RightBack] = vexRT[Ch3];
motor[StrafingWheelLeft] = (vexRT[Btn6U] - vexRT[Btn5U])*127;
motor[StrafingWheelRight] = (vexRT[Btn6U] - vexRT[Btn5U])*127;
motor[LiftLeft] = (vexRT[Btn7DXmtr2] - vexRT[Btn7UXmtr2])*127;
motor[LiftRight] = (vexRT[Btn7DXmtr2] - vexRT[Btn7UXmtr2])*127;
motor[IntakeLeft] = (vexRT[Btn8DXmtr2] - vexRT[Btn8UXmtr2])*127;
motor[IntakeRight] = (vexRT[Btn8DXmtr2] - vexRT[Btn8UXmtr2])*127;
}
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
How do I put the above code into a Competition Template? I’m guessing I stick it somewhere here
task usercontrol()
{
// User control code here, inside the loop
while (true)
{
// This is the main execution loop for the user control program. Each time through the loop
// your program should update motor + servo values based on feedback from the joysticks.
// .....................................................................................
// Insert user code here. This is where you use the joystick values to update your motors, etc.
// .....................................................................................
UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
}
}
But I don’t know how, or really where…
Thanks!
Team_323Z_Drive_Code.c (1.61 KB)