Go Down

Topic: randomSeed(analogRead(0)); (Read 2 times) previous topic - next topic


Another thread, with links to still more: http://arduino.cc/forum/index.php/topic,71841

On there you will find some potentially useful code to swizzle together a whole slew of analogue readings to get something with more entropy in it.  It's still taking a chance that analogue reads of floating pins have useful noise on them, and that is simply not a completely safe assumption.


Is it necessary for this function randomSeed(analogRead(0)); to be preceded by
Serial.begin(9600); as seen here...


In short, is the analogpin 0 affected by Serial.begin?


They are completely independent.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


As you can see, in 25 samples, there are only seven different values, which differ by only a couple of low end bits...

There are quite a few ways to get around that.

But the approach fails fundamentally because the stock analogRead() is incorrectly coded.

Go Up