Add timestamp during compile

Hi there,

Is it possible to put some kind of macro in an include file to add a timestamp in the code during compilation.

Tnx in avance,

grtz Jan

The compiler does that afaik... I can't remember the variable names right now.

edit: DATE TIME

For instance:

  Serial.begin (115200) ;
  Serial.print (__DATE__) ;
  Serial.print (" ") ;
  Serial.println (__TIME__) ;

You'd be better off with

  Serial.begin (115200) ;
  Serial.print (F(__DATE__)) ;
  Serial.print (" ") ;
  Serial.println (F(__TIME__)) ;

Thanks for the quick response, I will try this this evening.!

Grtz Jan

One that I use, also tells what IDE and Arduino you're using.

Serial.begin(9600);
  Serial.print(__FILE__ " " __DATE__ " " __TIME__);
  Serial.print("  IDE "); Serial.println(ARDUINO);