LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

biginner

Solved!
Go to solution
Solution
Accepted by topic author rikrak

Here.

"If you weren't supposed to push it, it wouldn't be a button."
Message 11 of 12
(530 Views)

@crossrulz wrote:

 

3. I recommend a 2D array to act as a lookup table for what the LED statuses should be.  You can use Build Array and Search 1D Array to get an index for the lookup table from the buttons.  You will then use Index Array to get your individual LED statuses.


Even easier would be an array of clusters. Paul's example is like herding cats^H^H^H^Hbooleans. Have a look at this old thread for an example.

 

 

Here is a quick modification using Paul's code, but using the cluster approach.

 

 

Here, errors in the booleans are much easier to spot and no parts of the code are ever hidden. (If you need to drive real LEDs, unbundling (or cluster to array) is easy. Just order them and name them as convenient.)

 

Curiously, creating a seven segment display of a number was one of the speed coding challenges at NI Week a few years ago. (See also) and I think creating an array of clusters as above would have been faster than what they actually did at the finals. 😄

 

 

Download All
0 Kudos
Message 12 of 12
(498 Views)