Thank you for all our help on my last post. It all really helped. To be honest, I finially just looked at the generated number and then based on its value fired off one of 5 sub routines. Here is the chunk of code i am using....Not very elegant but it works fine.

Begin:
Count = 0
W0 = W0 + 1
Peek PORTB, B2
IF B2 = %10000000 Then Test
GoTo Begin

Test:
Count = Count + 1
IF Count = 6 Then Begin
Random W0

IF W0 < 13105 Then loop1

IF W0 < 26210 Then loop2

IF W0 < 39315 Then loop3

IF W0 < 52420 Then loop4

IF W0 <= 65525 Then loop5

loop1:
Toggle 0 'Turn on LED connected to RB0
Pause 500 'Delay for .5 seconds
Toggle 0 'Turn off LED connected to RB0
GoTo TEST


Now I am on to my latest issue. First off I am using Pic Basic (The low cost version.) I am trying to seed the random number generator with a changing opening amount. So each time I use the device, the initial random pattern changes.

My queston is, the EEprom memory specifically location "0" should keep its value after the pick is powered down and then powered up again right??

So all I have to do is set an additional counter and incrament the seed by setting memory loaction 0 to this counter.