diff --git a/unix_time/unix_time.ino b/unix_time/unix_time.ino index 79ee21e..c886235 100644 --- a/unix_time/unix_time.ino +++ b/unix_time/unix_time.ino @@ -54,6 +54,11 @@ void setup() // Initialize the rtc object rtc.begin(); + + // The following lines can be uncommented to set the date and time + // rtc.setDOW(THURSDAY); // Set Day-of-Week to SUNDAY + // rtc.setTime(23, 11, 0); // Set the time to 12:00:00 (24hr format) + // rtc.setDate(14, 2, 2019); // Set the date to January 1st, 2014 } void loop() @@ -66,22 +71,11 @@ void loop() Serial.print(" -- "); Serial.println(rtc.getTimeStr()); - // Send Unixtime - // ** Note that there may be a one second difference between the current time ** - // ** and current unixtime show if the second changes between the two calls ** Serial.print("Current Unixtime.........................: "); Serial.println(rtc.getUnixTime(rtc.getTime())); - // Send Unixtime for 00:00:00 on January 1th 2014 - Serial.print("Unixtime for 00:00:00 on January 1th 2014: "); - t.hour = 0; - t.min = 0; - t.sec = 0; - t.year = 2014; - t.mon = 1; - t.date = 1; - Serial.println(rtc.getUnixTime(t)); - + Serial.print("Internal temperature: "); + Serial.println(rtc.getTemp()); // Wait indefinitely - while (1) {}; + delay(1000); }