Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Random function

(you are viewing a thread; or go back to list of threads)

Random function (by Alfredo)
Hi guys.

I need help.

I would like to do a random function for 5 outputs, it means "raffle"

I would like that the output keep 5 seconds Hi, and turn to Low , after it random again a new one output.

I have no idea how it's possible

Could you please help me
Wed Nov 4 2015, 19:30:07
(no subject) (by Jonathan Westhues)
LDmicro doesn't have a random number generator built in, but you can code one, as attached. This implements a "multiplicative linear congruential generator" with period 508, terrible by any normal mathematical standard but maybe good enough for a toy. A better algorithm could be implemented but would be more complex.
Wed Nov 4 2015, 22:02:53, download attachment rnd.ld
(no subject) (by MGP)
You can also find a program with random numbers in the collection samples.rar in this topic.

http://cq.cx/ladder-forum.pl?action=viewthread&parent=3820
Thu Nov 5 2015, 12:56:28
(no subject) (by Alfredo)
Tks guy..

I will check it.

Have a nice week!!
Sun Nov 8 2015, 10:27:25
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):