LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple blinking led

Hello, I'm trying to make 10 leds to blink in a sequence from 1 to 10 and also another version where they start blinking from 10 to 1

I'm new to LabVIEW so I'm having trouble making this to work ;C

I'm attaching my current progress but as you can see I've made some big mistakes. Is there a more simple way to make the diagram without creating separate loops for all 10 leds? 

0 Kudos
Message 1 of 14
(3,210 Views)

You have 95% too much code, you need much less.

Maybe this thread can give you some ideas. (look at all posts).

0 Kudos
Message 2 of 14
(3,193 Views)

so my final purpose is to use two sensors and light leds 1 to 10 when the first sensor picks something up and 10 to 1 when the second sensor is activated. I checked the link(thanks for the idea btw) but it seems a bit different from what I want to do, if I use the basic structure shown in the linked page and add something to that structure is my final goal possible?

0 Kudos
Message 3 of 14
(3,129 Views)

You can use exactly what is show in my links: Use an array of 10 LEDs and use "replace array subset" to turn one of them on. all you need is calculate the index of the appropriate LED based on the situation.

 

But first I recommend to go over the learning resources at the top of the forum. Your code is absolutely pointless and you should have a more solid foundation before continuing.

0 Kudos
Message 4 of 14
(3,119 Views)

sorry for the late reply. I've been studying labview and figuring out how to use arrays in my project but my problem is that I'm not using a linear design. I'm trying to make a 5x5 square shape with the leds covering four sides. In this case isn't it more difficult to make the arrays to turn on in order if I'm using separate arrays for each sides? Or is it just because I'm new at this 😞 Thanks for your help. I'll attach the basic form of what I'm trying to make. The triangle is for the sensor and the arrows represent the exits. I'm using leds to show an escape route.

0 Kudos
Message 5 of 14
(3,009 Views)

Note that in my examples, the operations are done on a boolean array, but the display is a cluster of LEDs. In a cluster, you can arrange the elements in any way you want and in any cluster order you want, so all this can very easily be done.

 

You can even make the cluster container transparent (example).

 

 

0 Kudos
Message 6 of 14
(2,997 Views)

See if this can give you some ideas....

 

 

0 Kudos
Message 7 of 14
(2,985 Views)

Thanks for your help! So I've made a new vi using clusters and I got the first case to work, but in the second case I want half of the leds in arrow 2 to blink like the first case and only the corners of the squares to blink on and off at the same time. I tried using the case structure but when I turn the switch off it won't work. Can you please tell me the problem here?

0 Kudos
Message 8 of 14
(2,949 Views)

I found the problem and fixed it, but I'm still struggling with a way to turn on only the top left side led and the right half of the top cluster. It keeps on starting from the first led. I'll attach my progress.

0 Kudos
Message 9 of 14
(2,934 Views)

Please simplify your code. You have large code fragments that only differ by a few diagram constants and small operations. Only things that differ belong inside case structures. You don't need any local variables. Learn about state machines! You need exactly one outer while loop where you hold the boolean array in a shift register and where you turn LEDs on and off depending on state. You really need to go back to the basic LabVIEW tutorials before continuing. You have at least 5x too much code! Simplify!

 

All you need is exactly one cluster of LEDs and one boolean array of the correct size. Adjust the cluster size of "array to cluster" to match.

 

Your code does exactly what you tell it to do. But iterating over an array of 0,1 seems quite silly, basically turning an inner FOR loop into a glorified case structure.

 

The top left is NOT an LED but a switch. It is supposed to be operated by the user, not by the code.

0 Kudos
Message 10 of 14
(2,925 Views)