Joystick malfunction

The partner joystick channel 4 wont read laterally. It only responds when I go diagonally, which is a problem. And it does this with every partner joystick I try.


#pragma config(Sensor, in1,    leftArm,        sensorPotentiometer)
#pragma config(Sensor, in2,    rightArm,       sensorPotentiometer)
#pragma config(Motor,  port1,           TopMotor,      tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port2,           FrontArms,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port3,           Lift1,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port4,           Lift2,         tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port5,           SideLifts,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port6,           FrontRight,    tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port7,           FrontLeft,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port8,           BackRight,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port9,           BackLeft,      tmotorVex393_MC29, openLoop)

#pragma platform(VEX2)

#pragma competitionControl(Competition)

#include "Vex_Competition_Includes.c"

void pre_auton()
{
	bStopTasksBetweenModes = true;
}

task autonomous()
{
	motor[FrontRight] = 127;
	motor[BackLeft] = 127;
	wait1Msec(2350);
	motor[FrontRight] = 0;
	motor[BackLeft] = 0;
	wait1Msec(2000);
	motor[BackRight] = 127;
	motor[FrontLeft] = 127;
	wait1Msec(1500);
	motor[BackLeft] = 0;
	motor[FrontLeft] = 0;

}

task usercontrol()
{
	while (true)
	{
		clearLCDLine(0);
		displayLCDPos(0,0);
		displayNextLCDString("LeftArm: ");
		displayNextLCDNumber(SensorValue(leftArm));
		clearLCDLine(1);
		displayLCDPos(1,0);
		displayNextLCDString("RightArm: ");
		displayNextLCDNumber(SensorValue(rightArm));
		motor[FrontRight] = vexRT(Ch2);
		motor[BackLeft] = vexRT(Ch2);
		motor[FrontLeft] = vexRT(Ch4);
		motor[BackRight] = vexRT(Ch4);
		motor[TopMotor] = vexRT(Ch4Xmtr2);
		motor[rightArm] = vexRT(Ch3Xmtr2)/2;
		motor[leftArm] = vexRT(Ch3Xmtr2)/2;
		if(vexRT[Btn6UXmtr2] == 1)
		{
			motor[SideLifts] = 127;
			wait1Msec(1);
			motor[SideLifts] = 0;
		}
		else if(vexRT[Btn6DXmtr2] == 1)
		{
			motor[SideLifts] = -127;
			wait1Msec(1);
			motor[SideLifts] = 0;
		}
		if(vexRT[Btn7UXmtr2] == 1)
		{
			motor[Lift1] = 127;
			wait1Msec(1);
			motor[Lift1] = 0;
		}
		else if(vexRT[Btn7DXmtr2] == 1)
		{
			motor[Lift1] = -127;
			wait1Msec(1);
			motor[Lift1] = 0;
		}
		if(vexRT[Btn8UXmtr2] == 1)
		{
			motor[Lift2] = 127;
			wait1Msec(1);
			motor[Lift2] = 0;
		}
		else if(vexRT[Btn8DXmtr2] == 1)
		{
			motor[Lift2] = -127;
			wait1Msec(1);
			motor[Lift2] = 0;
		}
		if(vexRT[Btn5U] == 1)
		{
			//motor[FrontLeft] = 127;
			motor[FrontRight] = 127;
			motor[BackLeft] = -127;
			//motor[BackRight] = -127;
			wait1Msec(1);
			//motor[FrontLeft] = 0;
			motor[FrontRight] = 0;
			motor[BackLeft] = 0;
			//motor[BackRight] = 0;
		}
		else if(vexRT[Btn6U] == 1)
		{
			//motor[FrontLeft] = 127;
			motor[FrontRight] = -127;
			motor[BackLeft] = 127;
			//motor[BackRight] = 127;
			wait1Msec(1);
			//motor[FrontLeft] = 0;
			motor[FrontRight] = 0;
			motor[BackLeft]  = 0;
			//motor[BackRight] = 0;
		}
		if(vexRT[Btn7LXmtr2] == 1)
		{
			motor[SideLifts] = 127;
			motor[Lift1] = -127;
			motor[Lift2] = -127;
			wait1Msec(1);
			motor[SideLifts] = 0;
			motor[Lift1] = 0;
			motor[Lift2] = 0;
		}
		else if(vexRT[Btn7RXmtr2] == 1)
		{
			motor[SideLifts] = -127;
			motor[Lift1] = 127;
			motor[Lift2] = 127;
			wait1Msec(1);
			motor[SideLifts] = 0;
			motor[Lift1] = 0;
			motor[Lift2] = 0;
		}
	}
}

What have I done wrong.EE

If your goal is to set TopMotor = partner Ch4, your code is correct. If that is not what is happening, I would look for errors in wiring.