I have a Tiva C TM4C123GXL (TM4C123GH6PM) and would like to display random data during every boot or soft boot.
My problem is that using rand() with time() to produce a random number, it always produces the same result:
int genrand(int min,int max){ // Generate a random number srand(time(NULL)); return rand()%(max-min)+min; }
I'm guessing this is because the amount of time that elapses between start up time and when my function is called is always the same.
Is there a better way to generate random numbers? Or could I save elapsed time to EEPROM or flash so that it persists after every soft boot?
Thanks.