Page 1 of 1

Random number in ChibiOS

Posted: Mon Jul 15, 2013 11:36 am
by RoccoMarco
Hi,
I need, if it exists, a function that returns a semi-random or a random number. Someone has any ideas?
Kindly regards

Re: Random number in ChibiOS

Posted: Mon Jul 15, 2013 1:19 pm
by Tectu
Take a look at mt19337. That's a well known algorithm to generate pseudo random numbers. It's based on the Mersenne-Twister algorithm.

And because I like you, a direct link for you: http://www.unc.edu/~gfish/rng_afm.c


~ Tectu

Re: Random number in ChibiOS

Posted: Mon Jul 15, 2013 1:39 pm
by RoccoMarco
Thank you my friend! :mrgreen: