View Single Post
  #4   Spotlight this post!  
Unread 13-01-2009, 09:42
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
Re: More than boolean Case Structure...

I think I can explain it...if not then this is how I did it


There is a box in LabView that is called Joystick.Get. From there wire a "unbundle by name" to the button output. Then from there make the unbundle by name box the right size (i.e. shows 3 buttons if you want 3 of them) and then click each one and select the button you want from the dropdown menu. Make a Boolean to array box, and wire each button into a separate input (resize as needed). Then wire the output of that into a case statement.


now the boolean to array converts trues and falses into binary numbers.

example
....................______
Button 1------|........| CASE STRUCTURE
Button 5------|........|------[?]
Button 3------|_____|


if button one is pressed, then the output of the boolean to array will be 1
if button 5 is pressed then 2
if button 3 then 4
if one AND five then 3
etc.

So you have a 0, Default (should be made automatically) for nothing pressed or for some value that isnt specified...(in example if 5 and 3 pressed or 1 and 3 pressed)

and then the rest of them you stick in the number you want. so

CASE STRUCTURE
<|0,Default|>
<|1 |> button 1 pressed
<|2 |> button 5 pressed
<|3 |> button 1 and 5 pressed
<|4 |> button 3 pressed


note: all button numbers represent those on the joysticks included in the kit...trigger being button 1

if I have misnamed anything, I am sorry cause im in school right now and I dont have labview open to check the names.
Reply With Quote