void setup () {
Serial.begin(9600);
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(’/’);
Serial.print(now.month(), DEC);
Serial.print(’/’);
Serial.print(now.day(), DEC);
Serial.print(’ ‘);
Serial.print(now.hour(), DEC);
Serial.print(’:’);
Serial.print(now.minute(), DEC);
Serial.print(’:’);
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
}
but when a start to serial monitor showed nothing. Any ideas? thanks and sorry for my english
petko44:
Yes serial monitor is set to 9600 baud.
Another ideas?
Does the initial message print the first time you run it ("RTC is NOT running!")?
You might have a hardware problem. Try a sketch that does not use the RTC, but just prints something. Does that work? Does the program upload over usb?
Thanks for the picture Ricky, Get out a magnifying glass and inspect the soldering job for "solder bridges between the pads where you attached the wires, and on the other side as well. It looks a bit spattered to me, and may be shorting out your connections.
I just connected the same RTC and downloaded the sketch in post #1 to IDE 1.69 all works as expected.
I am getting a different memory usage on my compile but that is probably a IDE version difference.
If you have proven serial communications and the wires going to the RTC are making proper connection it looks like you RTC is bad. I assume the RTC battery is OK.
You could write some simple code to toggle A4 and A5 to LEDs to make sure the pins are OK.
At a minimum, you should get this when the RTC is not there (unplugged):