About randomSeed(analogRead(0))

Anyone could explain what randomSeed is and why analogRead(0)?
I have read the codesheet, but I havent understood, due to lack of example...

Thank you :smiley:

Since there's no such thing as random in terms of microcontrollers, the function call random() runs an algorithm that creates a pseudo-random value based on a seed.

Since reading analogRead(0) would be an effectively random value, this effectively, gives you a random seed.

Thank you for the reply.

what do you mean pseudo-random?
why you state that analogRead(0) would be an effectively random value? How to know that?

what do you mean pseudo-random?

If you always seed it with the same value, you will get the same results each time you use it.

why you state that analogRead(0) would be an effectively random value?

If nothing is connected to the analogue pins, they can pick up environmental noise. ( can be influenced, but mostly random )

creativen:
what do you mean pseudo-random?

Search Google for the difference between "real" random and "pseudo" random.

creativen:
why you state that analogRead(0) would be an effectively random value? How to know that?

Floating pins pick up stray electromagnetic fields in the air and have random voltages applied to them. So using analogRead reads an "effective" analog value.

Write a sketch that prints the value of analogRead(0) to the Serial monitor. Then move finger near the ATmega328 chip. Watch how the values randomly change.