Broken? Joystick

I got my VEX kit a few days ago and after charging the robot batteries and joystick batteries, I followed the procedure of connecting the cortex and joystick. Following that, I wrote some code to run a motor when I hit 8U on the controller. The motor was on port 2 with a motor controller 29. When I hit 8U, the motor was running but was jittering. Thinking the motor was bad, I tried a different one. Same problem. Changed motor controller. Same problem. Tried a different port. Same problem. Tried different buttons on different channels. Same problem. Used a USB A-A Tether cord instead of VEXnet Keys. Same problem. Tried different code using a button to trigger the motor. No jittering.

I think this is a joystick problem. I’ve flashed the master code of the cortex and joystick five times, flashed the robotc firmware 15 times, and recalibrated the joystick so many times, I don’t remember.

If my joystick needs to be replaced, will it cost me anything? I just paid $1,500 for this.

Thanks,
SamThe(Disappointed)

If you post your code it will help us check if there is an issue with that (to me this sounds like a code issue) . Your kit should come with a 90 day warranty on all the electronics so if it is indeed a fault with the joystick you can contact @VEX Support for a replacement or repair.

task main()
{
while (1==1)
{
motor[mainMotor] = vexRT[Ch6];
if (vexRT[Btn6U] == 1)
{
motor[mainMotor] = 127;
}
else if (vexRT[Btn6D] == 1)
{
motor[mainMotor] = -127;
}
else
{
motor[mainMotor] = 0;
}
}
}

@SamTheGreat

This is the problem I believe. There is no Ch6, so I don’t know what the cortex will do about that, but if it sees it as a joystick sending a 0, the code will constantly switch from sending that 0 and the ±127 on Btn6U/D

But i’ve also tried all of the other channels. Including 2, 3 and 8. I still get the same problem.

Just delete that line of code. It’s not needed with your if statements updating the motor.

Ok, I’ll be sure to try that… I’ll get back to you in a few days.

No matter what channel you use you will get the same problem. What is happening is when you press the button it tells the motor to go at +/- 127. But since you also have the channel set to run that motor the cortex is sending out 2 different values. A value of 0 from the channel and a value of +/- 127 from the buttons. Causing the motor to jump between these 2 values is whats causing the jittering. Get rid of the code for the channel and it will work just fine.