title: How can i create a truly random number in C (IDE: MPLAB)
body: <p>I am making a game on a PIC18F2550 and I need to create a random number between 1 and 4. 
  I've found out already that the rand() function sucks for truly random numbers.
  I've tried the srand(time(NULL)), this is the main file</p>
  
  <pre><code>#include &lt;time.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  void main(void) {
      srand(time(NULL));
      init(); 
      while(timed_to_1ms()) {
          fsm_game();
      }
  }
  </code></pre>
  
  <p>this is the fsm_game.c file</p>
  
  <pre><code>void randomSpawn(int time2) {
      if(counter%time2==0) { 
          int x = rand()%4 +1; // Makes number between 1 and 4
      }
  }
  </code></pre>
  
  <p>When I try to build this I get an error saying:</p>
  
  <p>":0: error: (499) undefined symbol:
      _time(dist/default/production\Dontcrash.production.obj) "</p>
  
  <p>I think the problem may be in the fact that a microProcessor doesn't 'know the time', so if that's the case, what can I do to solve this problem?</p>