Quote:
Originally Posted by MotorHead
Read each button and put into a binary array. Then convert the array to a number. Your select case can then test for which number shows up. If you are watching four buttons, there would be a possible 16 cases. But since you probably only need to detect if one button is pressed, your test cases would be 1, 2, 4, 8.
|
If I really had to do something like this, I would make a subvi, using a typedef'ed enum. This enum would then be used on the case selector with the output options/code. This would allow future changes pretty easily.
Quote:
Originally Posted by Joe Ross
One way I like to do this is to use multiple selects. ... This assumes that only one button will be pressed at a time.
|
I have to say that this would become hard to follow whenever extra code is added. It would also be very difficult to scale, and modify into the future. (Like on competition day)