LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED step function

Solved!
Go to solution

Hello, I'm new to VI. I'm trying to graph the blinking of an LED. For example, when the LED is on it'll have a max amplitude ( 1 for simplicity), when off, it'll go back to zero.The user is able to control the blink rate. I'm having trouble making the connection from controlling the LED to visualizing it on a graph.

0 Kudos
Message 1 of 6
(4,041 Views)

boolean to 0,1 and wire the output to a chart indicator.

0 Kudos
Message 2 of 6
(4,039 Views)

Well I got something using that, but the graph is displaying incredibly fast. I cannot get a smooth graph.

LED.PNG

 

0 Kudos
Message 3 of 6
(4,031 Views)

What value are you using for the loop's wait?  You probably want something in the 100 to 500ms range.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(4,001 Views)
Solution
Accepted by topic author Arc7

With that code you will only get 1 data point per cycle.  You likely want to have it display some "time" on the graph so it looks like a square signal instead of a Dirac delta function.

 

Look into the Elapsed Time Express VI.  Then you can set your loop delay to something constant (1ms or so), wire your knob into the target time, and only toggle your Boolean when it sees time has elapsed.

 

Edit:  Something like this

Square Wave generator.png

Message 5 of 6
(3,992 Views)

You can use two separate loops.  One to display the waveform (consistent time-base/update) that operates with the lowest wait time desired and the other for the knob selector that controls the added delay for the frequency of change.  The display should look like a slinky oscillating when you move the knob up then down again.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 6 of 6
(3,986 Views)