Go Down

Topic: Random function (Read 1 time) previous topic - next topic

tomek


Hej,

I'm surging for a random function for Arduino;

I know I can get a pseudo-random number if I read one of the analog-Inputs I'm not using, but this just work if something happened there, like: touching the input, otherwise I get always a very similar number.

So at the end I need a random number between 1 and 720, maybe someone have a nice idea?

Thanks a lot.
tomek

Gabe462

I need this too...

Anything?

Gabe

Gabe462

Actually it's just

rand()

It appears to be 16 bit... (I never got a number > 32334, so I'm guessing)


Gabe

mrbbp

hy

for a random : read an analog input with nothing plug on.
for more info do a search, we answer few week ago to this question ;)
here : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1145117943/ :-[

regards

eric

tomek

yes, yes we know you can use a analog input, but i think this is not the "nice" way, isn't it that this radom number get influrenced by the analog input, futhermore by the surrounding of the input, room temperature etc.

it seems to produces alway the same numbers, after a file i get some numbers which looks like random, but i'm not so shure about this,....

would be nice to have a real random funktion,...

hej då,
tomek

Go Up