We’re a team with limited labview experience. We knew how to change the button assignments in years past, but now we don’t know how to change where things are assigned on our xbox controller. We know what the buttons are numbered on the controller, but can’t find where to change them in the program. We think that they are in something called a cluster, but don’t know what that means or how to change it. Can someone shed some light on this for me?
Thanks for helping. We see this website but we’re still kinda confused about how we’re supposed to change the button assignments on it. Do we create more clusters? We’re using mecanum drive by the way. And if we do, do we then connect those arrays to other blocks?
Sorry if I’m misunderstanding, but I think you’re asking the question of how you can change which button does what on the robot, correct?
If you want to get a different button on the controller, you simply need to change which index of the array you are getting. In previous years, you used the Cluster, which you could then Unbundle By Name to get the values (“Button 1”, “Button 2”, etc.). You would now get these values from the “Buttons” array with Index Array. (now use index “0”, “1”, etc.) In order to change the assignments, you just need to change what index you are reading from in the array.
I’ve included a small piece of sample code to put into your Teleop for driving Mecanum, but I think it can also be able to run it on the driver station to get the axis values. The front panel has an Indicator to show you what the numbers in the blue Constant blocks (Block Diagram) should be.
If you wish, you can convert the array into a cluster via the Array to Cluster in the Array palette and unbundle by name like in previous years. It’s an easier way to program it than using unlabeled array outputs, IMO.
If you would like to write a simple subVI that does the cluster conversion, or returns the buttons as named outputs, you can then use the subVI over and over and it will match your joystick or usage.
Do you need help doing this?
The problem with the named cluster output is that it doesn’t match all joysticks and will cause even more confusion when it is incorrect.
We did exactly that for several different types of game controllers. Right now we have specific VIs for the “Attack 3” joystick and “AirFlow” and “Afterglo” brand gamepads. The component names of the Axes and Buttons bundles match the labels on the controllers.