3 * example code illustrating Time library with Real Time Clock.
9 #include <DS1307RTC.h> // a basic DS1307 library that returns time as a time_t
13 setSyncProvider(RTC.get); // the function to get the time from the RTC
14 if(timeStatus()!= timeSet)
15 Serial.println("Unable to sync with the RTC");
17 Serial.println("RTC has set the system time");
22 digitalClockDisplay();
26 void digitalClockDisplay(){
27 // digital clock display of the time
29 printDigits(minute());
30 printDigits(second());
34 Serial.print(month());
40 void printDigits(int digits){
41 // utility function for digital clock display: prints preceding colon and leading 0