4 Replies Latest reply: Feb 1, 2012 12:43 PM by dakota77 RSS

Arduino-1.0 and time.h

dakota77

I am trying to upgrade a sketch to Arduino 1, but get compilation errors.
This sketch was functioning perfectly with Arduino Alpha.
I want to store second() in a string.
#include <Time.h> 
#include <SoftwareSerial.h>
String ds;
void setup()  {
  setTime(21,05,00,14,1,2012); // set the time
  ds = String(second());
  delay(1000);
}
void loop(){   
}
The compiler returns the following error :
C:\arduino-1.0\libraries\Time\Time.cpp:268: error: 'millis' was not declared in this scope
Is time.h not compatible with Arduino-1.0 ?
Thanks for your help.

Hello,

I am trying to upgrade a sketch to Arduino 1, but get compilation errors. This sketch was functioning perfectly with Arduino Alpha.

I use time.h  to get the time and date as: second, minute, hour, day, month and year.

I want to store second() in a string.

 

#include <Time.h> 

#include <SoftwareSerial.h>

 

String ds;

 

void setup()  {

  setTime(21,05,00,14,1,2012); // set the time

  ds = String(second());

  delay(1000);

}

 

void loop(){   

}

 

The compiler returns the following error :

C:\arduino-1.0\libraries\Time\Time.cpp:268: error: 'millis' was not declared in this scope

 

 

Is time.h not compatible with Arduino-1.0 ?

Thanks for your help.

Hello,