cancel
Showing results for 
Search instead for 
Did you mean: 

flashing led

Karamdeek
Member

flashing led

Hey, i'm new to Labview and i have a problem to do... i'm finding a little problem in creating a flashing led :

  • If you have chosen “flashing” from the switch, then the LED should light up for a time equal to the value of the “ON TIME” control and then the LED should turn off for a time equal to the value of the “OFF TIME” control.

any help will be very much appreciated Smiley Happy
regards,
karamdeek

9 REPLIES 9
aeastet
Trusted Enthusiast

Re: flashing led

Message contains an attachment

Did you do it like this or is it more complicated?

Tim
GHSP
NIquist
Trusted Enthusiast

Re: flashing led

Sounds like homework so I'm hesitant to provide a complete solution.  Post whatever attempt you've made so far and we'll help you out.

 

Hint: A shift register holding a boolean in a while loop is a good place to start.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Karamdeek
Member

Re: flashing led

it's a small part of a big problem.... not the whole HW, the only part that is causing me trouble Smiley Tongue

 

well my problem is with how to input the time for the on and off phase of the led. should it be using a flat sequence inside a while loop and using a wait block?

Karamdeek
Member

Re: flashing led

ty, sorry but i couldnt open it since i'm using the version 8.2

aeastet
Trusted Enthusiast

Re: flashing led

If you need to controll the timing then things get more complicated. You will probably need to have the blink feature in a seperate loop and and send an evet that tells it to blink. THen you can set up timing in that loop to handel the different blink time and have the program turn on an off the light.

Tim
GHSP
aeastet
Trusted Enthusiast

Re: flashing led

Message contains an attachment

Here is 8.0 version

Tim
GHSP
Karamdeek
Member

flashing led

is it possible to do it using a flat sequence containg the wait time ?

Ray.R
Knight of NI

Re: flashing led

Why would you ever want to use a Flat Sequence? You don't need one.  You should avoid using Flat Sequences.  Especially Stacked Sequences.

 

If you want to swap the While Loop to a Flat Sequence, no you cannot use a Flat Sequence.

 

NIquist
Trusted Enthusiast

Re: flashing led

Message contains an attachment

 


@Karamdeek wrote:

is it possible to do it using a flat sequence containg the wait time ?


Flat sequences are frowned upon as there's almost always a better way to solve sequencing problems with proper program flow.

 

 

I think this part of your problem is to help you learn about shift registers and structures within structures.  These basic skill are required when you want to control a logical flow of events.

I'm probably giving away too much here but look at the pic and try to figure out what is in the other cases that make this VI work.  Once you do, break it down into small steps or draw a flow chart and see how the labview structures mimic the decisions you have to make to cause the LED to flash as your requirements specify.

 

Good Luck!

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019