 }
 
 void setup() {
+  // get saved data from EEPROM
+  EEPROM.get(ADDR_RETIRE_TIME, retire_time);
+  EEPROM.get(ADDR_BRIGHTNESS,  brightness);
+
   // define PWM brightness pin for output
   pinMode(PinBacklight, OUTPUT);
   // set up the LCD's number of columns and rows:
   lcd.begin(16, 2);
   lcd.clear();
-
-  // get saved data from EEPROM
-  EEPROM.get(ADDR_RETIRE_TIME, retire_time);
-  EEPROM.get(ADDR_BRIGHTNESS,  brightness);
+  analogWrite(PinBacklight, brightness);
+
+  // configure clock to use RTC
+  if(! RTC.read(tm)){
+    // RTC isn't working
+    while(true){
+      update_lcd("RTC read error :/", String(millis()/1000));
+      delay(250);
+    }
+  }
+  setSyncProvider(RTC.get);
+  if(timeStatus() != timeSet){
+    // RTC isn't set
+    while(true){
+      update_lcd("Time is not set :/", String(millis()/1000));
+      delay(250);
+    }
+  }
 
   // assemble menu
   mm.add_item(&mi_backlight, &mcb_backlight);

void mcb_backlight(MenuItem* pmi);
void mcb_backlight(MenuItem* pmi){
  //
}

void mcb_retirement_year(MenuItem* pmi);

 * http://www.amazon.com/gp/product/B0076FWAH8
 * http://www.amazon.com/gp/product/B00LZCTMJM
 */

//#include <Chronos.h>

/* 
 set up for the RTC
