This will not "verify", I get the error message "randNumber was not declared in this scope.
would someone like to recommend a tutorial on this subject,ie random numbers. Thanks, Chaso.
randomSeed() is meant to be called once, to seed the random number generator. It is not meant to be called on every pass through loop().
So, it should be moved to setup(). At which point, you might as well omit it, since the time returned by millis() will be consistent every time you start the Arduino, meaning that you will always get the same set of random numbers.
If you want a different random number sequence each time it runs then you should add the line
randomSeed(analogRead(0));
(or similar) in the setup() section. This uses a random value read from an analog pin to seed the random number generator. If you want to repeat the same sequence for testing, seed it with a fixed value.
Back again to solve my unsolved problem.
Have tried the two suggestions from #5 and #6, but still will not "verify". Error message " random number was not declared in this scope" ?
What randnumber ? and where to declare it ? Surely randnumber is 255 and declared in scope.
Oh,bye the way, Arduino "ERW" 1.0.4. is the title at the very top of every sketch page.
Would love to solve this randonSeed problem. C.
Hi Guys, sorry I am late getting back to you, have had problems login in to forum. Thankyou, Keith RB and wildbill, you got it right for me, I had " randomNumber", instead of "randNumber". Thanks for your help.
Chaso.