Hi, I’m a programmer with team 4732. I have a question about ports. How do you figure out what port your joystick is connected to and what the buttons are mapped as? (I’m using a wired XBox controller if it makes a difference).
Take a look at the USB tab of the driver station.
Okay thanks. One more thing, I see that the joystick axes and triggers are labeled with numbers, how do I get the numbers for the other buttons? Do the numbers correspond with the squares that light up when I press them?
I believe the numbers correspond with the squares if using Java. If using C++, they’re one higher than the console. Not sure about LabView.
You can also go to “set up USB game controllers” in Windows to see the button numbers and calibrate the joysticks.
With the new driver station, any time you plug in a controller, it will default to port 0, and then so on. Next, go to the “USB” section on the driver station. There you will see any connected controllers as well as all the axis and buttons associated with that controller. These buttons are held in an array (in lab view that is) so the first button on the screen (the leftmost top button) will be button zero, the next one down will be button one and so on. As far as Axis, they should be labeled from 1-X straight down. Correct me if I’m wrong, but this is how my team does it.