# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Re: Generate Random numbers

Single loop solution for strings:

Message 11 of 13
(654 Views)

## Re: Generate Random numbers

Im trying to generate a random number between -10 and 10 and display a LED to display negative values, an LED for the range of 0 to 5, and  an LED for values greater or equal to 5.

Message 12 of 13
(542 Views)

## Re: Generate Random numbers

@jr10 wrote:

Im trying to generate a random number between -10 and 10 and display a LED to display negative values, an LED for the range of 0 to 5, and  an LED for values greater or equal to 5.

This really should be in its own thread but...

"random number (0-1)", multiply by 20, subtract 10.

Feed the output into a "less than 0" comparison, feed the output of that into an LED.

Feed the output of the subtract 10 into a "greater than" comparison together with "5", feed the output to another LED.

Feed the output of the subtract 10 into an "in range and coerce" together with 0 and 5, feed the output to another LED.

Message 13 of 13
(522 Views)