Skip to content

Commit

Permalink
restored time print on serial. Added youtube link
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsaturn committed May 19, 2023
1 parent 46ccaa5 commit 1454bd1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The current firmware was tested on 77.5KHZ single frequency device. It is the 4

Is a basic box - hat for these devices, for example M5StickC or M5StickC-Plus, also should be work in M5CoreInk device.

![Box DCF77 M5StickCPlus Hat](box/collage.jpg)
[![Box DCF77 M5StickCPlus Hat](box/collage.jpg)](https://youtu.be/C50qMhYiE60)

**Files:**

Expand Down
19 changes: 1 addition & 18 deletions src/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ void printLastTimeUpdate() {
M5.Lcd.printf("%02d:%02d:%02d", hour(), minute(), second());
}

void serialPrintDigits(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);
}

void serialPrintClock() {
// digital clock display of the time
Serial.print(hour());
serialPrintDigits(minute());
serialPrintDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.println();
Serial.printf("%02d:%02d:%02d %02d.%02d.%02d\r\n", hour(), minute(), second(), year(), month(), day());
}
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ void dcfLoop() {
tts = millis();
time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available
if (DCFtime != 0) {
Serial.println("Time is updated");
Serial.printf("\rTime is updated: ");
setTime(DCFtime);
printLastTimeUpdate();
serialPrintClock();
}
printYear();
printTime();
Expand Down

0 comments on commit 1454bd1

Please sign in to comment.