Need some guidance. Am a hardware engineer slowly going soft. Have been running a DS1307 on a Mega for a year and enjoying coding although DS1307 is as accurate as a sundial so have upgraded to a Chronodot DS3231.
Have downloaded Chronodot.h and .cpp and put in my RTClib library. Have found an example Chronodot sketch that gives now.seconds, now.minutes etc which will enable me to integrate it to the 50 pages of code I have written without a loss of a year of my life. The example sketch will not compile.........
[/code// Date, time and temperature functions using
// a Chronodot RTC connected via I2C and Wire lib
#include <Wire.h>
#include "Chronodot.h"
Chronodot RTC;
void setup () {
Serial.begin(57600);
Serial.println("Initializing Chronodot.");
Wire.begin();
RTC.begin();
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.year(), DEC);
Serial.print('/');
if(now.month() < 10) Serial.print("0");
Serial.print(now.month(), DEC);
Serial.print('/');
if(now.day() < 10) Serial.print("0");
Serial.print(now.day(), DEC);
Serial.print(' ');
if(now.hour() < 10) Serial.print("0");
Serial.print(now.hour(), DEC);
Serial.print(':');
if(now.minute() < 10) Serial.print("0");
Serial.print(now.minute(), DEC);
Serial.print(':');
if(now.second() < 10) Serial.print("0");
Serial.print(now.second(), DEC);
Serial.println();
Serial.print(now.tempC(), 1);
Serial.println(" degrees Celcius");
Serial.print(now.tempF(), DEC);
Serial.println(" degrees Farenheit");
Serial.println();
delay(3000);
}]
The errors I get are 'Class Chronodot' has no member named 'begin' also 'isrunning' also 'adjust'
Could I be using the wrong Chronodot.h file, are there more than one of these files out there or have I just done something silly?
Gerry O'Donovan