03-20-2017 12:58 PM
Here.
03-23-2017 02:46 PM - edited 03-23-2017 02:50 PM
@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. 😄