LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Blinking LED

Hi,

 

in my project I need to make a led blink every time a multiple of 0,01 appears.

How could I do it?

My vi it's here!

Aprecciate your help 😉

0 Kudos
Message 1 of 2
(1,705 Views)

First, Index Array is expandable.  Drag the bottom border downward.  You'll get indices 0, 1, and 2 automatically with out having to enter any constants, all within a single node.  No need to split the array wire.

 

Second,  no need to read the entire file every iteration of the while loop.  Move that out of the loop.

 

You are going to have issues determining when a multiple of 0.01 appears, you are working with floating point numbers, and in the binary world of computers, floating points aren't always exact.  You might find that 0.01  turns out to be really 0.00999999 or something like that.  Actually, when I expand the number of digits of precision, I see your 0.01 constant is actually 0.010000000000000000200000.   Those tiny errors can grow when dealing with multiples, so something you think will be a multiple may not be.

 

You'll probably have to set a tolerance for yourself.  Multiply your number by 100.  Round to the nearest integer.  Subtract from those two numbers.  See if the difference is less than whatever tolerance is satisfactory for you.

 

0 Kudos
Message 2 of 2
(1,672 Views)