Hi,
I need, if it exists, a function that returns a semi-random or a random number. Someone has any ideas?
Kindly regards
Random number in ChibiOS
Moderators: RoccoMarco, lbednarz, tfAteba
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
Re: Random number in ChibiOS
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
And because I like you, a direct link for you: http://www.unc.edu/~gfish/rng_afm.c
~ Tectu
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times