The rand() function in the stdlib.h is suppost to generate random numbers. However in C programming the random number is generated from a variable eg time, date,.. Then in Keil, and the controller, how does this rand() function work.. Cause i tried using it, it worked ok.. The problem is everytime the controller is reseted, it generates the same set of random numbers. And if u randomize again, it will just become a patern instead of a random value.. Example: after reset: 3,5,8,1,4,...etc etc.. after the reset button again... 3,5,8,1,4,...etc etc.. Does this mean there is no other way to generate random numbers?
Are you setting the random number generator seed value using the srand function? Jon