This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Generating a Random number for ARM7

I have to generate a random number by taking the input as a timer value...
SO can anyone suggest how to get this????

Thanks in Advance

Parents
  • "...a really bad idea, am I right?"

    Yes, you are right.

    No, it is nothing to do with April 1st. I really did see that line of code!

    The line of code was being executed close to the start of main, so the seed for the pseudo-random number generator had been set by the initialisation of the library. The first random number produced was identical from one reset to another. So the value passed to srand was always the same. So subsequent calls to rand always produced the same sequence of values.

Reply
  • "...a really bad idea, am I right?"

    Yes, you are right.

    No, it is nothing to do with April 1st. I really did see that line of code!

    The line of code was being executed close to the start of main, so the seed for the pseudo-random number generator had been set by the initialisation of the library. The first random number produced was identical from one reset to another. So the value passed to srand was always the same. So subsequent calls to rand always produced the same sequence of values.

Children
No data