Hey there,
I'm trying to get my RTC DS1302 running.
Shouldn't be a problem, but:
When i upload the simple sketch:
#include <DS1302.h>
DS1302 rtc(2, 3, 4);
void setup()
{
// Set the clock to run-mode, and disable the write protection
rtc.halt(false);
rtc.writeProtect(false);
Serial.begin(9600);
// The following lines can be commented out to use the values already stored in the DS1302
rtc.setDOW(SUNDAY); // Set Day-of-Week to FRIDAY
rtc.setTime(20, 14, 25); // Set the time to 12:00:00 (24hr format)
rtc.setDate(21, 5, 2018); // Set the date to August 6th, 2010
}
void loop()
{
Serial.println(rtc.getTimeStr());
Serial.println(rtc.getDateStr());
delay (1000);
}
and I check the serial monitor: the output is:
20:14:25
21.05.2018
00:10:13
10.02.2012
20:14:27
21.05.2018
00:10:14
10.02.2012
20:14:29
21.05.2018
00:10:18
10.02.2012
20:14:31
21.05.2018
00:10:19
and so on....
So for some reason, there is another date/time running next to the set time/date...
I can't get rid of it.
Does anybody know how to help me please?
Thanks in advance
Woody!