View Full Version : Button 9?
Potatoes
15-02-2015, 12:27
We are using an Xbox 360 controller. We are trying to open a solenoid when the left stick is pressed down, close it when the right stick is pressed. The driver station reads Left Stick as button 8, Right Stick as button 9 (buttons start at 0). However, in LabView the joystick button unbundle only goes to button 8, as shown below. Expanding the bundle just shows me more "Button[8]"s, which all read the same value (Left Stick). My question is, how can I get it to read the Right Stick (button 9) input?
HostileGato
15-02-2015, 12:48
I am a new programmer but I have think I have a solution to your problem. Replace the button cluster with an index array instead and label it with numeric constants you want such as nine. Team 358 has some great examples on what this would look like. http://www.team358.org/files/programming/ControlSystem2015-2019/labview/index.php
Greg McKaskle
15-02-2015, 12:51
Or right click on the node that converts from array to cluster, select the Cluster Size... item, and in the little dialog, enter 12, or however many buttons your controller has. Notice that it defaults to eight and was causing the limit of the buttons.
Index Array has no such limit since its size is determined at runtime and not compile time.
Greg McKaskle
Mark McLeod
15-02-2015, 12:51
right-click on the Array To Cluster and choose Cluster Size to increase the number of buttons.
Potatoes
15-02-2015, 14:07
It worked! Awesome, thank you!
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.