|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Xbox controller has 10 buttons, Button Array has 9 elements?
Posted question here, but after, figured it was best to start a new thread to be seen.
So we are trying to code a feature with "button 9" of the xbox controller, but the button array in labview only has 9 elements. Both the team 358 diagram and the array index start with 0. So the Joystick has 10 buttons, from 0 to 9, yet the array only has 9 elements from 0 to 8. Tell me where I messed up. http://www.chiefdelphi.com/forums/sh...6&postcount=12 |
|
#2
|
||||
|
||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
i had the same problem. what you need to do is right click and add a new variable to the array. i do no have labview in front of me now but if you have more trouble let me know and i will get a screen shot for you
|
|
#3
|
|||||
|
|||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
I'm afraid I don't follow what problem you are encountering.
Perhaps a screen shot or snippet? I split out the buttons from a joystick and can see all 10 (0-9). You can also use Index Array to specifically ask for button 9. |
|
#4
|
|||||
|
|||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
Oh, you're using old code from last year?
The button cluster was removed from the palette this year, so I didn't even think of it. Last edited by Mark McLeod : 01-21-2015 at 11:14 PM. |
|
#5
|
||||
|
||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
Mark,
The "default" button array only has 9 elements, so we can't pull the 10th button, "Buttons[9]" I added the array to cluster and the unbundle by name, to show issue. I will try to add another value, but I would think that would be in the "Get Values" vi. |
|
#6
|
|||||
|
|||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
I understand now.
To get the 10th button right-click on Array to Cluster and choose Cluster Size... Change 9 to 10. You should see Button 9 in the button cluster. Array to Cluster defaults to 9 items. Last edited by Mark McLeod : 01-21-2015 at 11:14 PM. |
|
#7
|
||||
|
||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
Interesting, but we were having an issue with the code above with the index array, and pulling the boolean data from the 9th element. . .
If the problem is in the array to cluster, then the index should have worked... humm.. |
|
#8
|
|||
|
|||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
I agree with Mark. I tested the buttons with the TI board for 32 buttons, and the underlying code is good for 128 or more. The silly conversion to cluster doesn't know how many elements you need, and has to decide at compile time. It has that popup that almost nothing else has, and trips up people all the time -- one of these days ...
Greg McKaskle |
|
#9
|
|||||
|
|||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
Quote:
Now I want a game controller with 128 buttons, just like my tv remote... Last edited by Mark McLeod : 01-22-2015 at 07:51 AM. |
|
#10
|
||||
|
||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
Quote:
|
|
#11
|
|||
|
|||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
DIJOYSTATE2 has four POVs, 128 buttons, and eight axes and quite a few calculated values. Since DInput has this, I was assuming that it matched HID. I poked around and found different opinions. I hope I never have a device that pushes that boundary.
Greg McKaskle |
|
#12
|
||||
|
||||
|
Re: Xbox controller has 10 buttons, Button Array has 9 elements?
After retesting code last night we are also NOT having an issue with the index array either!
(We are having an issue understanding troubleshooting labview) (and that cluster got me too) and you two can stop talking about these controllers, they are generating hardware requests. . . |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|