Hello
This is my first post here. I have done quiote a few simple Picaxe projects over the years but this one is made more complicated by the need for randomness.
I am looking for some code that will trigger 6 output pins in a random order, and at random times within a short time frame, say 5 seconds.
My current thought process is to generate 6 random numbers, then initiate a while loop which has 6 if statements in. Each if statement checks a counter against the generate random number (and also checks its not matched on a previous loop), if it matches it triggers the associated pin in not it increments the counter and carrys on looping until all 6 have been triggered.... clear as mud? This works apart from the random numbers all just an increase on the last. So they are random but they just increase in value. Therefore the triggers do happen at random times but always in the same order.
I have done lots of reading on random and how it's not random, but suedo random and is seeded from the last number so I am guessign this might be why. I have also tried seeding random with different prime numbers but again the values always come out in teh same order.
I was wondering if anyoen had any advice on how to make this work in the way i'm currently doing it or have any bright ideas on how to achieve it another way.
Thanks in advanced for your time
This is my first post here. I have done quiote a few simple Picaxe projects over the years but this one is made more complicated by the need for randomness.
I am looking for some code that will trigger 6 output pins in a random order, and at random times within a short time frame, say 5 seconds.
My current thought process is to generate 6 random numbers, then initiate a while loop which has 6 if statements in. Each if statement checks a counter against the generate random number (and also checks its not matched on a previous loop), if it matches it triggers the associated pin in not it increments the counter and carrys on looping until all 6 have been triggered.... clear as mud? This works apart from the random numbers all just an increase on the last. So they are random but they just increase in value. Therefore the triggers do happen at random times but always in the same order.
I have done lots of reading on random and how it's not random, but suedo random and is seeded from the last number so I am guessign this might be why. I have also tried seeding random with different prime numbers but again the values always come out in teh same order.
I was wondering if anyoen had any advice on how to make this work in the way i'm currently doing it or have any bright ideas on how to achieve it another way.
Thanks in advanced for your time