We’re trying to program for 2 drivers. However, this is the first time we used a partner joystick. Currently, the link light does not light up at all.
We know the robot drives with a single driver code. However we are not 100% certain if our telephone cable or joystick works. We tried 3 different telephone cables and our partner joystick is new. Our main joystick is a year old, however we do know it worked with 2 drivers last year. I highly doubt it was damaged since then.
This is our current code.
#pragma config(Motor, port1, LeftRoller, tmotorVex393, openLoop)
#pragma config(Motor, port2, FrontRight, tmotorVex393, openLoop)
#pragma config(Motor, port3, BackRight, tmotorVex393, openLoop)
#pragma config(Motor, port4, FrontLeft, tmotorVex393, openLoop)
#pragma config(Motor, port5, BackLeft, tmotorVex393, openLoop)
#pragma config(Motor, port6, Funnel, tmotorVex269, openLoop)
#pragma config(Motor, port7, LeftLift, tmotorVex393, openLoop)
#pragma config(Motor, port8, RightLift1, tmotorVex393, openLoop)
#pragma config(Motor, port9, RightLift2, tmotorVex269, openLoop)
#pragma config(Motor, port10, RightRoller, tmotorVex393, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
int X2 = 0, Y1 = 0, X1 = 0, threshold = 15;
while(true)
{
if(abs(vexRT[Ch3]) > threshold)
Y1 = vexRT[Ch3];
else
Y1 = 0;
//Create "deadzone" for X1/Ch4
if(abs(vexRT[Ch4]) > threshold)
X1 = vexRT[Ch4];
else
X1 = 0;
//Create "deadzone" for X2/Ch1
if(abs(vexRT[Ch1]) > threshold)
X2 = vexRT[Ch1];
else
X2 = 0;
//Remote Control Commands
motor[FrontLeft] = vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
motor[BackRight] = - vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];
motor[FrontRight] = -vexRT[Ch3] + vexRT[Ch1] + vexRT[Ch4];
motor[BackLeft] = vexRT[Ch3] + vexRT[Ch1] - vexRT[Ch4];
if (vexRT[Btn7LXmtr2]==1)
{
motor[Funnel]=127;
}
else if (vexRT[Btn7RXmtr2]==1)
{
motor[Funnel]=-127;
}
else if (vexRT[Btn8LXmtr2]==1)
{
motor[LeftLift]=-127;
motor[RightLift1]=127;
motor[RightLift2]=127;
}
else if (vexRT[Btn8RXmtr2]==1)
{
motor [LeftLift] = 80;
motor [RightLift1] = -80;
motor [RightLift2] = -80;
}
else if (vexRT[Btn6UXmtr2]==1)
{
motor[RightRoller]=-127;
motor[LeftRoller]=-127;
}
else if (vexRT[Btn5UXmtr2]==1)
{
motor[LeftRoller]=127;
motor[RightRoller]=127;
}
else
{
motor[LeftLift] = -20 ;
motor[RightLift1] = 20 ;
motor[RightLift2] = 20 ;
motor[LeftRoller] = 0 ;
motor[RightRoller] = 0 ;
motor[Funnel] = 0 ;
}
}
}