LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a led drop in an array.

Hi guys,

 

Basically what I want, is when I push the okay button. The corresponding led in the array drops down and stays on true. So when I push the okay button again on the right time, in the same row a led drops down and stacks up. 

The idea was to make a little game, some sort of 4 in a row. With two players and a timer, so you have to stack 4 ASAP to get points. 

Maybe you guys can help me where to find information. Or take a look at my VI i dont think its very difficult. But for me it is lol. 

Thanks a lot guys.

0 Kudos
Message 1 of 7
(2,575 Views)

You've done a great job telling use what you want, but how about letting us know where you are stuck. This will allow us to give you the correct advice.

0 Kudos
Message 2 of 7
(2,557 Views)

You have an incredible amount of duplicate code: sequence frames that only differ in the value of a single boolean. Have a look at a state machine instead. Try to use a single 2D array, where you simply flash top top row in sequence until OK is pressed.

Message 3 of 7
(2,552 Views)

Hi, Futurebound,

 

I tried it by my thought, and I'm not sure if it is what you want.

You can simplified the running LED by RadioButton, it can remove some controls and local variables.

All thing left is just how to manipulate the LED array, I use Insert Into Array.vi to get it accumulating or stacking.

Hope it helps.

Message 4 of 7
(2,514 Views)

Thanks, i dont know a lot about arrays jet so im looking in to it now. I wil also look in to state machines as you call it. I followed one class in Labview two years ago and it wasnt that helpfull at all.  

0 Kudos
Message 5 of 7
(2,480 Views)

Thanks a lot for the VI, this looks like what i want. Now i just have to figure out how to give points when theres four in a row! .

0 Kudos
Message 6 of 7
(2,478 Views)

Maybe this old post can give you some ideas for the dropping code. 😄 Seems a bit simpler.

0 Kudos
Message 7 of 7
(2,418 Views)