 {  
   if( now() != prevDisplay) //update the display only if the time has changed
   {
-    prevDisplay = now();
-    digitalClockDisplay();  
+
   }
+}
+
+int words(int minutesOfDay, word_t* buffer)
+{
+ int bufferIndex = 0;
+  /*
+  int hours = (minutesOfDay + 2) / 60;
+ int minutes = (minutesOfDay + 2) % 60;
+ int minuteIndex = minutes / 5;
+ int hourIndex = hours % 12;
+ 
+ buffer[bufferIndex++] = &WORT_ES;
+ buffer[bufferIndex++] = &WORD_IST;
+ 
+ buffer[bufferIndex++] = MINUTE_WORDS[minuteIndex];
+ buffer[bufferIndex++] = CONNECTOR_WORDS[minuteIndex];
+ 
+ if (minuteIndex == 5 || minuteIndex == 7)
+ {
+ buffer[bufferIndex++] = &MINUTE_HALB;
+ }
+ 
+ if (minuteIndex == 0 && hourIndex == 1)
+ {
+ buffer[bufferIndex++] = &STUNDE_EIN;
+ }
+ else
+ {
+ if (minuteIndex > 4)
+ {
+ hourIndex = (hourIndex + 1) % 12;
+ }
+ buffer[bufferIndex++] = HOUR_WORDS[hourIndex];
+ }
+ 
+ if (minuteIndex == 0)
+ {
+ buffer[bufferIndex++] = WORT_UHR;
+ }
+ */
+ return bufferIndex;
 }
 
 void digitalClockDisplay(){
   // digital clock display of the time
-  Serial.println("");
   Serial.print(hour());
   printDigits(minute());
   printDigits(second());

  Serial.println("Waiting for DCF77 time ... ");
  Serial.println("It will take at least 2 minutes until a first update can be processed.");
  while(timeStatus()== timeNotSet) { 
     // wait until the time is set by the sync provider     
     Serial.print("RTC: ");
     digitalClockDisplay();
     delay(2000);
  }
}


time_t time;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);

struct word_t
{
  int index;
  int length;
};

int words(int minutesOfDay, word_t* buffer);


const word_t WORT_ES = {0, 2};
 const word_t WORT_IST = {3, 3};
 const word_t MINUTE_FUENF = {7, 4};
 const word_t MINUTE_ZEHN = {11, 4};
 const word_t MINUTE_FUENFZEHN = {7, 8};
 const word_t MINUTE_ZWANZIG = {15, 7};
 const word_t MINUTE_DREIVIERTEL = {22, 11};
 const word_t MINUTE_VIERTEL = {26, 7};
 const word_t WORT_NACH = {35, 4};
 const word_t WORT_VOR = {39, 3};
 const word_t MINUTE_HALB = {44, 4};
 const word_t STUNDE_ZWOELF = {49, 5};
 const word_t STUNDE_ZWEI = {55, 4};
 const word_t STUNDE_EIN = {57, 3};
 const word_t STUNDE_EINS = {57, 4};
 const word_t STUNDE_SIEBEN = {60, 6};
 const word_t STUNDE_DREI = {67, 4};
 const word_t STUNDE_FUENF = {73, 4};
 const word_t STUNDE_ELF = {77, 3};
 const word_t STUNDE_NEUN = {80, 4};
 const word_t STUNDE_VIER = {84, 4};
 const word_t STUNDE_ACHT = {89, 4};
 const word_t STUNDE_ZEHN = {93, 4};
 const word_t STUNDE_SECHS = {100, 5};
 const word_t WORT_UHR = {107, 3};
 
const word_t* MINUTE_WORDS[] = {
 0, &MINUTE_FUENF,
 &MINUTE_ZEHN, &MINUTE_VIERTEL, &MINUTE_ZWANZIG,
 &MINUTE_FUENF, &MINUTE_HALB, &MINUTE_FUENF,
 &MINUTE_ZWANZIG, &MINUTE_VIERTEL, &MINUTE_ZEHN,
 &MINUTE_FUENF
 };
 
 const word_t* CONNECTOR_WORDS[] = {
 0, &WORT_NACH,
 &WORT_NACH, &WORT_NACH, &WORT_NACH, &WORT_VOR,
 0, &WORT_NACH, &WORT_VOR, &WORT_VOR, &WORT_VOR, 
 &WORT_VOR
 };
 
 const word_t* HOUR_WORDS[] = {
 &STUNDE_ZWOELF,
 &STUNDE_EINS, &STUNDE_ZWEI, &STUNDE_DREI,
 &STUNDE_VIER, &STUNDE_FUENF, &STUNDE_SECHS,
 &STUNDE_SIEBEN, &STUNDE_ACHT, &STUNDE_NEUN,
 &STUNDE_ZEHN, &STUNDE_ELF
 };

void setup() {
  Serial.begin(9600);

  Serial.println("Setting system clock from RTC module");
  setSyncProvider(RTC.get); 
  DCF.Start();
