www.piclist.com/techref/microchip/math/index.htm?key=random

BY : Bob Ammerman email (remove spam text)

Here is a simple solution to the problem.....

Given a function

unsigned char PRNG(unsigned char limit)

that generates a pseudo-random number in the range 0..limit-1

val = PRNG(7); // start with a pin in 0..7

for (;;)

{

val = (val + 1 + PRNG(6)) & 7;

}

This works because each successive 'random' value can be any value except

the current one.

Bob Ammerman

RAm Systems

{Original Message removed}

seeking: microchip devices 16F

See also: www.piclist.com/techref/microchip/math/index.htm?key=random