Arduino Time Library


i trying seed srand() random, more random result, tried using c++
code: [select]
#include <ctime.h> library. compiler said there no such library, downloaded arduino
code: [select]
#include <time.h> library, compiler gave me errors that, too. errors compiler gave me below. can me decipher errors on time.h one? also, library , command should use seed srand()? compiler error attached below.

code: [select]
srand(time(null));

the time library not going provide useful seed srand. if need use else try
code: [select]
#include <timelib.h>

the usual way try quasi-random seed read voltage on analog input not connected anything.
code: [select]
 srand(analogread(a0));

pete


Arduino Forum > Using Arduino > Programming Questions > Arduino Time Library


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor