Page 2 of 2

Re: Initialize random numbers generator

PostPosted: Thu May 22, 2014 10:28 am
by rodot
Mmh, I will include a random seed picker function in the library, that's a good idea.

Re: Initialize random numbers generator

PostPosted: Thu May 22, 2014 3:24 pm
by FreddyBoubil
Image

Re: Initialize random numbers generator

PostPosted: Wed May 28, 2014 5:32 pm
by rodot
Hey guys,
I just added a new pickRandomSeed() function which should be called just after gb.begin();
It's a mix of the battery voltage, the ambiant light and the time elapsed, which depends on how long does the user take to press 'A' to skip the start menu. It works fine with the emulator.
Here is what it does:
Code: Select all
randomSeed(battery.voltage * ~micros() + backlight.ambientLight + micros());

As there is a multiplication of 2 pretty large numbers it should overflow several times and give a random random seed ("random random", haha).

Re: Initialize random numbers generator

PostPosted: Fri Jun 20, 2014 8:40 am
by FreddyBoubil
Just saw this, thanks a lot !

Re: Initialize random numbers generator

PostPosted: Fri Oct 06, 2017 5:31 pm
by EvangelineChen
You can try portable generators because using best portable generator is the best option generatorsideas.com