Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How to assign buttons in 2015 (http://www.chiefdelphi.com/forums/showthread.php?t=133569)

awehunter 27-01-2015 13:28

How to assign buttons in 2015
 
Hey there,

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?

nwall 27-01-2015 14:00

Re: How to assign buttons in 2015
 
This year the button assignments are now located in an array instead of a cluster. The first section in this webpage (http://wpilib.screenstepslive.com/s/...e-2014-to-2015), Joystick Get, shows the change for 2015, and the button array begins at 0 instead of 1.

You can change the button assignments by just changing the index you're looking at in the array.

awehunter 27-01-2015 17:19

Re: How to assign buttons in 2015
 
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?

nwall 27-01-2015 18:00

Re: How to assign buttons in 2015
 
1 Attachment(s)
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.

pastelpony 30-01-2015 19:43

Re: How to assign buttons in 2015
 
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.

Greg McKaskle 31-01-2015 06:58

Re: How to assign buttons in 2015
 
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.

Greg McKaskle

Alan Anderson 31-01-2015 14:53

Re: How to assign buttons in 2015
 
Quote:

Originally Posted by Greg McKaskle (Post 1436462)
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.

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.


All times are GMT -5. The time now is 08:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi