|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
Re: More than boolean Case Structure...
Wow thanks, if think that what ive looking for
..ill try it later in the robot class.. i think this would solve it but keep generate ideas ![]() |
|
#3
|
|||
|
|||
|
Re: More than boolean Case Structure...
As Kevin suggested, you can also have a control with more than just on/off.
If you can set this up as a list of options rather than a number of buttons, create a ring or enum control and wire it to the case structure. Fill the control with all the possible cases, and you can create a case in the case structure for each choice in the enum/ring control. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CRio more than nationals | lenny8 | FRC Control System | 6 | 16-11-2008 12:33 |
| More than One Regional? | smurfgirl | Regional Competitions | 35 | 26-03-2008 14:21 |
| More than 1 autonomos... | Jimmy_Team7011 | Programming | 5 | 16-03-2008 15:33 |
| more than 4 ir controls? | Vanquish | Programming | 2 | 12-01-2008 14:52 |
| Robowarriors: More visited than CD! | Tim Arnold | General Forum | 11 | 26-10-2007 11:54 |