The simple true random number generator would be to run a timer while the pushbuton is held down - this timer could increment while the button is pushed and thus the number generated would be the time the user held the button down. If a fast incrementing counter is used this would be absolut= ely random since you cannot push a button for exactly 34 uS repeatedly, unle= ss you have superhuman reflexes. > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Michael Rigby-Jones > Sent: 12 August 2002 05:39 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Random sequence > > > > -----Original Message----- > > From: Sid Weaver [SMTP:NEWZED@AOL.COM] > > Sent: Monday, August 12, 2002 4:24 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: Re: Random sequence > > > > In a message dated 08/12/2002 11:19:23 Eastern Daylight Time, > > ilinux@DKGOMEZ.COM writes: > > > > > > > Is there a way to a random sequence from either external > input, or from > > > the programming itself. I=B9m doing led dies, and the method used = just > > > flashes through the sequence, until the user stops pushing the butt= on. > > I=B9d > > > rather just have them push it once, no long period to hold, to star= t > > > sequence, and then have it use a random source to determine the num= ber > > > instead. > > > > > > Dave Gomez > > > > > > > Hello, Dave > > > > Just write > > > > start > > random x > > do your flashing thing > > goto start > > > > if you make x a byte you get random numbers from1 to 1024. > > > > Sid > > > Well, I don't know what HLL you are using, or how you manage to > fit 1024 in > a single byte :0) > > Truly random numbers are not easy to generate, and the topic has been > discussed countless times on the list. If you want some numbers > that simply > appear to be random, you can quite easily make a pseudo-random number > generator in a PIC. Take a look at > http://www.piclist.com/techref/microchip/rand8bit.htm for some examples. > > Regards > > Mike > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body