Thread: Random Numbers
View Single Post
  #3   Spotlight this post!  
Unread 18-01-2004, 20:45
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Random Numbers

Quote:
Originally Posted by Dave Flowerday
You might want to try
Code:
rnd = rand();
And make sure you include stdlib.h in your user_routines.c file.
Ok, I tried that. Get this: ...\user_routines.c:267:Warning [2058] call of function without prototype:

Code:
unsigned char Random(void)
{
  unsigned int rnd;
//  Right Here! ************************
  rnd = Rand();
  
  rnd = rnd / RAND_MAX;
  return (unsigned char) (rnd & 0xFF);
}
And I included Std.lib.: #include <stdlib.h>


Other Half: ...\user_routines.c:289:Error [1131] type mismatch in assignment:

Code:
void Default_Routine(void)
{ 

//...

//Between Here...
pwm01=pwm03=Random;
pwm02=pwm04=Random;
//... And Here.

//...  
}
P.S.- Tell me if it's some simple Syntax stuff. I'm still trying to get the hang of it.