ARDUINO 1.5.4 : compiling problem using a RTC library

Hi,

I have been using (Under Arduino 1.03 IDE on winXP) a Mega, and a RTC breakout board.

The RTC chip is the DS3231, and I have been using an interesting library for it, that makes unix time available on an arduino, including synchronization of the milli function of the arduino, with the RTC.
the link where I found the description:
Arduino RTC Turorial - Sparky's Widgets
I have been using happily this library in my projects.

Now, I would like to migrate to an Arduino Due, which strictly requires the Arduino 1.5 IDE.
I have dowloaded the ARDUINO 1.5.4.

My problem:
there is now something wrong with the library when using it with ARDUINO 1.5.4 (see errors pasted below when testing compilation without upload; I am still using a Mega for this test, and no DS3231 is hooked to the mega) ).

The attachment file contains the small test program, and the .h and .cpp library files
Could someone help for this ?

Thanks


Under ARDUINO 1.5.4, I get the following compiling errors:

In file included from ds3231_test_V1_0.ino:4:
C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:20: error: ‘time_t’ does not name a type
C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:21: error: ‘time_t’ has not been declared
C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:22: error: ‘tmElements_t’ has not been declared
C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:23: error: ‘tmElements_t’ has not been declared
ds3231_test_V1_0.ino: In function ‘void setup()’:
ds3231_test_V1_0:8: error: ‘class DS3231’ has no member named ‘get’
ds3231_test_V1_0:8: error: ‘setSyncProvider’ was not declared in this scope
ds3231_test_V1_0:9: error: ‘timeStatus’ was not declared in this scope
ds3231_test_V1_0:9: error: ‘timeSet’ was not declared in this scope
ds3231_test_V1_0:14: error: ‘setSyncInterval’ was not declared in this scope
ds3231_test_V1_0.ino: In function ‘void digitalClockDisplay()’:
ds3231_test_V1_0:25: error: ‘day’ was not declared in this scope
ds3231_test_V1_0:27: error: ‘month’ was not declared in this scope
ds3231_test_V1_0:29: error: ‘year’ was not declared in this scope
ds3231_test_V1_0:31: error: ‘hour’ was not declared in this scope
ds3231_test_V1_0:32: error: ‘minute’ was not declared in this scope
ds3231_test_V1_0:33: error: ‘second’ was not declared in this scope
ds3231_test_V1_0:35: error: ‘now’ was not declared in this scope
ds3231_test_V1_0:36: error: ‘timeStatus’ was not declared in this scope
ds3231_test_V1_0:37: error: ‘timeSet’ was not declared in this scope

ds3231_test_V1_0.ino (1.31 KB)

DS3231RTC.h (562 Bytes)

DS3231RTC.cpp (2.39 KB)

You need to port (re-write) the code for the Due as it is not an AVR chip. Most likely you have problems with any direct port manipulation and with SPI.

Mark

OK, sorry. :~ It was a silly mistake: I had included the "DS3231RTC" library, but it needed also a "TIME" library in addition. It now works on Arduino 1.5.4.

In my last message, things went fine for compilation under Arduino 1.5.4, and selecting the arduino Mega 2560 board.

STILL A PROBLEM: When now selecting an Arduino Due board under Arduino 1.5.4, and trying to compile, I get error messages (see below). I have no clue of what is causing a problem, and the error message is cryptic: the only '' in the .h file are in a block comment, and at line 31, there is no ''

Help!

Error messages upon compiling In file included from ds3231_test_V1_0.ino:4: C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:31: error: expected ')' before '' token C:\Program Files\Arduino\libraries\DS3231RTC/DS3231RTC.h:31: error: expected ')' before '' token ds3231_test_V1_0.ino: In function 'void setup()': ds3231_test_V1_0:8: error: request for member 'get' in '1074666080u', which is of non-class type 'Rtc*' ds3231_test_V1_0.ino: In function 'void digitalClockDisplay()': ds3231_test_V1_0:38: error: request for member 'getTemp' in '1074666080u', which is of non-class type 'Rtc*'