output from a modified demo (code below)
This is reproducable on T3.2 and T3.6
code:
red lines are modified from the example.
It happens after 5 minutes.
Code:
10:04:58 1 1 2020
10:04:59 1 1 2020
10:05:00 1 1 2020
[COLOR=#ff0000]20:21:30 28 1 2020
20:21:31 28 1 2020
20:21:32 28 1 2020
20:21:33 28 1 2020[/COLOR]
This is reproducable on T3.2 and T3.6
code:
Code:
/*
* TimeRTC.pde
* example code illustrating Time library with Real Time Clock.
*
*/
#include <TimeLib.h>
#include <Wire.h>
[COLOR=#ff0000]time_t getTeensy3Time()
{
return Teensy3Clock.get();
}[/COLOR]
void setup() {
[COLOR=#ff0000] setSyncProvider(getTeensy3Time);
setTime(10, 0, 1, 1, 1, 2020); //set initial time[/COLOR]
Serial.begin(9600);
while (!Serial) ; // wait until Arduino Serial Monitor opens
//setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus()!= timeSet)
Serial.println("Unable to sync with the RTC");
else
Serial.println("RTC has set the system time");
}
void loop()
{
if (timeStatus() == timeSet) {
digitalClockDisplay();
} else {
Serial.println("The time has not been set. Please run the Time");
Serial.println("TimeRTCSet example, or DS1307RTC SetTime example.");
Serial.println();
delay(4000);
}
delay(1000);
}
void digitalClockDisplay(){
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.println();
}
void printDigits(int digits){
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(":");
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}
It happens after 5 minutes.
Last edited: