zuzu
Member level 3
Hello friends,
Trying to distribute packet error over time in some protocol, I need to generate a custom (pseudo) random sequence up to certain number.
I my MCU I have only rand() and srand(int seed) functions.
But I need to generate a PR number from 0 to N where N can be anywhere up to 2047. The seed is not important, but non-repetitive values are, and cycle them all up to N.
Any idea appreciated.
Trying to distribute packet error over time in some protocol, I need to generate a custom (pseudo) random sequence up to certain number.
I my MCU I have only rand() and srand(int seed) functions.
But I need to generate a PR number from 0 to N where N can be anywhere up to 2047. The seed is not important, but non-repetitive values are, and cycle them all up to N.
Any idea appreciated.