i m tryin to create a dice for which random no. generation is necessary.
i had used rand() function under stdlib.h but it keeps on givin the same no.
what are other method of generation random no. using C language
my code was like this
int r;
r=rand()%7;
this should generate random no. between 0 to 6 but instead it generated only 2 every time it is executed.
You must provide the seed before call that function.
That´s because RAND performs a pseudo-randomizing algorithm.
Generally we use an assyncron event to trigger an internal uC counter and feed the function.