Hallo Ich habe ein triviales Problem mit PIC 8 bit C XC8 Bei time mäkelt der Compiler "Kenne ich nicht" :0: error: undefined symbol: _time(dist/default/debug\Dice.X.debug.obj) Das dumme ist, es hat mal funktioniert , dann habe ich was geändert und nun habe ich große Augen und weiß nicht weiter. #include <time.h> //// Unterfuntion int GetRandom() { time_t toc; time(&toc); // <<<<<<< hier srand((int)toc); srand(toc); int zahl = rand (); return(zahl); }
Läuft auf dem Controller denn ein Betriebssystem das die Zeit verwaltet mithilfe einer RTC? Wenn nein, wo soll dann die Zeit herkommen?
Die XC8 Doku hat da eine klare Aussage. Note The time() routine is not supplied, if required the user will have to implement this routine to the specifications outlined above.
OK das heißt eine Time Funktion muß erst implementiert werden. Ich dachte das geht über den timer.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.