Anybody know how to Generate a random number?
If you check the pdfs that came with the compiler (CD:\mcc18\doc\MPLAB-C18-Libraries.pdf), there is a random number type thing, but I can't use it!
Here:
//Prototype
int rand(void);
//...
/****************************************
* FUNCTION NAME: Random
* PURPOSE: Returns a random char
* CALLED FROM: Where ever
* ARGUMENTS: none
* RETURNS: unsigned char
****************************************/
unsigned char Random(void)
{
unsigned int rnd;
rnd = Rand;
rnd = rnd / RAND_MAX;
return (unsigned char) (rnd & 0xFF);
}
The thing is, When I build, I get
...\user_routines.c:267:Error [1105] symbol 'Rand' has not been defined
Help?!?