If the button is interrupt serviced, then almost any button press will=20 generate a random number with just a simple counter (not too many people=20 I know can repeatably stop a counter with a 4 MHz clock). Just read the=20 bottom 3 bits of the counter, subtract 1 if greater than 6 or less than=20 1, and you're there. This DOES introduce a less than totally uniform=20 distribution if you need true randomness--then you must do a little more=20 work and implement a mod-6 counter. --Doug Dave Gomez wrote: > Hello all, > 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 > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. >=20 >=20 >=20 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.