Joystick issue


I’m relatively new to command based programming. I have code on Netbeans for our team’s robot from last year, so it uses the 2014 control system.

I have the 2015 driver station and I change it to the '14 DS & FMS so I have comms and robot code.

When I plug in a controller (Xbox), the Joysticks box turns green and if I go to the USB devices on the DS, the lights will show up corresponding to the buttons that I press on the Joystick (e.g. 1-A, 2-B, etc).

However, when I enable teleop and press buttons, the robot does not respond even though I have specific buttons perform commands. I have already printed out the joystick and button values (-1.0 to 1.0 for joysticks and true/false for buttons) and the joystick values are always 0.0 and the button values are always false, even though I’m pressing them.

I don’t think it’s a code error because I went over it with one of our team’s mentors.

Any help is appreciated


If you are running a 2014 robot with the 2015 DS, the port you assign the joystick to in the DS settings menu needs to be one less than what you assign it in the code.

For example, if you have:

Joystick driveStick = new Joystick(1);

You need to assign the Joystick to port 0 in the DS settings menu to read that controller in the code.

I had the same issue and solved it here.

Thanks Mitchel Stokes it helped