> -----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 >=20 > In a message dated 08/12/2002 11:19:23 Eastern Daylight Time,=20 > ilinux@DKGOMEZ.COM writes: >=20 >=20 > > 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 = button. > I=B9d > > rather just have them push it once, no long period to hold, to = start > > sequence, and then have it use a random source to determine the = number > > instead. > >=20 > > Dave Gomez > >=20 >=20 > Hello, Dave >=20 > Just write >=20 > start > random x > do your flashing thing > goto start >=20 > if you make x a byte you get random numbers from1 to 1024. >=20 > Sid >=20 Well, I don't know what HLL you are using, or how you manage to fit = 1024 in a single byte :0)=20 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