flymann
February 21, 2026, 10:41am
1
Moin,
ich stolpere gerade über die Time Bibliothek, obwohl diese instaliert ist stolpere ich über ein #include < Timelib.h>. Wieso bekomme ich ständig eine Fehler Meldung. Im Netz finde ich keine andere Bibliothekeinbindung. Oder muß ich in den Einstellungen der Arduino IDE noch was zusätzlich einfügen?
Danke Thomas
fony
February 21, 2026, 10:46am
2
flymann:
Timelib.h
Falsche Schreibweise
TimeLib.h
Funktioniert dein DCF nicht ?
Rintin
February 21, 2026, 12:24pm
3
Einmal den Code bitte und welche Fehlermeldung genau...
Apropos DCF... DCF 77 Probleme - #71 by Rintin
fony
February 21, 2026, 12:44pm
4
genau die
Timelib.h
Timelib.h gibt es nicht TimeLib.h aber schon.
flymann
February 21, 2026, 1:46pm
5
Hier mal die Fehler Meldung:In file included from /home/thomas/Arduino/UhrTFT/UhrTFT.ino:6:0:
/home/thomas/Arduino/libraries/DCF77/DCF77.h:9:10: fatal error: Time.h: No such file or directory
#include <Time.h>
^~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1 . Anbei noch der Sketch auf dem sich das ganze bezieht.
UhrTFT.ino (2,2 KB)
fony
February 21, 2026, 1:52pm
6
Nicht als ino das kann man mit Tablet ohne zustz App nicht öffnen
Gehe in die Lib such die dcf77.h und editiere die Zeile 9 neu:
#include <TimeLib.h>
fony
February 21, 2026, 2:02pm
9
Du hast falsche DCF
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_GC9A01A.h>
#include <DCF77.h>
#include <TimeLib.h>
// ================= TFT =================
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
Adafruit_GC9A01A tft(TFT_CS, TFT_DC, TFT_RST);
// ================= DCF77 =================
#define DCF_PIN 2
#define DCF_INTERRUPT 0 // Pin 2 beim Uno
#define BUTTON_PIN 4
DCF77 DCF(DCF_PIN, DCF_INTERRUPT);
// ================= Variablen =================
time_t lastSyncTime = 0;
bool synced = false;
unsigned long lastDraw = 0;
// ================= Setup =================
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(DCF_PIN, INPUT_PULLUP);
tft.begin();
tft.fillScreen(GC9A01A_BLACK);
drawBoot();
DCF.Start();
}
// ================= Loop =================
void loop() {
// ===== Taster startet neuen Sync =====
if (digitalRead(BUTTON_PIN) == LOW) {
synced = false;
DCF.Start();
drawSyncScreen();
delay(500);
}
// ===== DCF Zeit holen =====
time_t DCFtime = DCF.getTime();
if (DCFtime != 0) {
setTime(DCFtime);
lastSyncTime = now();
synced = true;
}
// ===== Anzeige jede Sekunde =====
if (millis() - lastDraw > 1000) {
lastDraw = millis();
drawClock();
}
}
// ================= Anzeigen =================
void drawBoot() {
tft.setTextColor(GC9A01A_WHITE);
tft.setTextSize(2);
tft.setCursor(40, 110);
tft.println("DCF77 Uhr");
}
void drawSyncScreen() {
tft.fillScreen(GC9A01A_BLACK);
tft.setTextColor(GC9A01A_YELLOW);
tft.setTextSize(2);
tft.setCursor(30, 110);
tft.println("SYNC...");
}
void drawClock() {
tft.fillScreen(GC9A01A_BLACK);
// ===== Zeit =====
char buf[10];
sprintf(buf, "%02d:%02d:%02d", hour(), minute(), second());
tft.setTextColor(GC9A01A_WHITE);
tft.setTextSize(4);
tft.setCursor(20, 90);
tft.println(buf);
// ===== Datum =====
char datebuf[16];
sprintf(datebuf, "%02d.%02d.%04d", day(), month(), year());
tft.setTextSize(2);
tft.setCursor(40, 150);
tft.println(datebuf);
// ===== Status =====
if (synced) {
tft.setTextColor(GC9A01A_GREEN);
tft.setCursor(70, 200);
tft.print("OK");
} else {
tft.setTextColor(GC9A01A_RED);
tft.setCursor(50, 200);
tft.print("WAIT");
}
}
mit der
DCF77 - Arduino Libraries kompiliert sauber .
Der Sketch verwendet 16036 Bytes (52%) des Programmspeicherplatzes. Das Maximum sind 30720 Bytes.
Globale Variablen verwenden 403 Bytes (19%) des dynamischen Speichers, 1645 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
fony
February 21, 2026, 2:02pm
10
hast auch alte falsche LIb.
fony
February 21, 2026, 2:16pm
12
Wie ich sehe gibt's schon zwei Topic mit dem gleichem Problem
Rintin
February 21, 2026, 2:17pm
13
Was hier offensichtlich nicht das Problem ist.
Welche Version der DCF77 hast installiert? und welche Version der TimeLib?
Hast du die DCF irgendwann mal von Hand gepatched und es vergessen?
fony
February 21, 2026, 2:21pm
14
die gezeigte,
Rintin:
Version der TimeLib
1.6
`version=1.6
author=Michael Margolis
maintainer=Paul Stoffregen`
Rintin
February 21, 2026, 2:24pm
15
fony:
1.6
Die TimeLib ist inzwischen bei 1.6.1...
s.h. Time - Arduino Libraries
fony
February 21, 2026, 2:24pm
16
NEIN alle alten DCF habe gelöscht, wollten nicht funktionieren mit Nano und Uno.
Nur wie sich herausgestellt hat was meine schuld, habe den DCF Modul mit 5V gegrillt, damals, ist eine Weile her.
fony
February 21, 2026, 2:27pm
17
Von mir aus, da ich die angezeigte in mehreren Projekten habe bleib wie es ist,
fony
February 21, 2026, 2:33pm
18
Time und TimeLib sind beide vom Paul und die Time hat die Version 1.61
name=Time
version=1.6.1
author=Michael Margolis
maintainer=Paul Stoffregen
Wie ich sehe gibt es TimeLib und Time wo aber beide das gleiche sind nur Versionen sind andere
Rintin
February 21, 2026, 2:42pm
19
@flymann die Lösung ist entweder #7 oder #8 . Und lass dich bitte nicht von @fony verwirren.
fony
February 21, 2026, 3:23pm
20
Keiner von den Beiden hat dir geschrieben das der GC9A01 ist ein 3.3V Display, das bedeutet man darf den nicht Direkt an 5V System (NANO R3, UNO R3 und andere ) Klemmen.
Wie empfindlich das Display ist weiß ich nicht, nutze für Displays nur ESP32