LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read each button from a gamepad

Hi, what I would like to do is read input from a usb gamepad  and change a Color box and change text infront of the box. However, the controller outputs a t/f for each button.

 

(Button 1,2,3,4 will change color, and 5,6,7,8 will determine what text will display over the color box( 4 diff text displays))

My problem is how do I say "Def. If neither 1,2,3,4 are presses-black, If button 1 is pressed-blue, If button 2 is pressed-green...etc..."

 

I have tried a case structure, but they can only say T/F once, which would be fine but the color box can only accept one input... I have attached a picture of what I have that wont work, I need an alternative...

 

Thank you, 

Brent S.

0 Kudos
Message 1 of 4
(2,541 Views)

You can build array of the buttons and then give it to "search 1 d array" and then use a single case structure.

0 Kudos
Message 2 of 4
(2,514 Views)

Like this

0 Kudos
Message 3 of 4
(2,511 Views)

Since your data is already a cluster you can use the Cluster to Array, then use the seach 1D array for a True eliminating the need for the build array.

0 Kudos
Message 4 of 4
(2,489 Views)