ieee488:
Sounds like another piece that needs to be debugged first and working for integration..
Your absolutely right. However, how come that using the same code on an Arduino Uno and Mega, i can read the time through serial monitor on the Uno, but not on the Mega? Is there a difference in programming between the Uno and Mega that I am not aware of?
[edit] code:
#include <DS3231.h>
// Init the DS3231 using the hardware interface
DS3231 rtc(SDA, SCL);
void setup() {
rtc.begin();
Serial.begin(115200);
//rtc.setDOW(WEDNESDAY); // Set Day-of-Week to SUNDAY
//rtc.setTime(10, 49, 20); // Set the time to 12:00:00 (24hr format)
//rtc.setDate(21, 3, 2018); // Set the date to January 1st, 2014
}
void loop() {
//Serialmonitor. Verwijder // bij void setup. De bautraid van 9600 kan niet samen openstaan met het lcd, dan werkt het lcd niet.
Serial.print("Tijd: ");
Serial.println(rtc.getTimeStr());
delay(1000);
}