-//#define DEBUG
+#define DEBUG
 #include <EEPROM.h>
 
 // RTC

    case FADING_BACKLIGHT_MODE:
      fadingBacklight(current, forceChange);
      break;
    case NIGHTLIGHT_MODE:
      nightlight(current, forceChange);
      break;
  }
  forceChange = false;
  
  if ( digitalRead(MODE_SWITCH_PIN) == LOW )
  {
    if ( !pressed )
    {
      pressed = true;
      mode++;
      if ( mode > NIGHTLIGHT_MODE )
        mode = BACKLIGHT_MODE;

      forceChange = true;
      printTime(current);
      Serial.print(F(" Switching mode to "));
      Serial.println(mode);
      EEPROM.put(MODE_INDEX,mode);

      clearPixels();
    }
  }
  else

#define BACKLIGHT_MODE 0
#define CLOCK_MODE  1
#define FADING_BACKLIGHT_MODE 2
#define ALARM_ENTER 3
#define NIGHTLIGHT_MODE 4
char *modes[] = {"Backlight", "Clock", "Fader", "AlarmEnter", "Nightlight"};

#define MODE_SWITCH_PIN 10
int mode = CLOCK_MODE; // BACKLIGHT_MODE;
char s[200];

DateTime compileTime;
DateTime wakeTime = DateTime( 2016,1,1, // ignore y,m,d
                              5,45); // 5:45am

// EEPROM indexes
const int MODE_INDEX = 0;
const int WAKE_INDEX = (MODE_INDEX+sizeof(mode));

/*******************************************************************************
*******************************************************************************/
void setup() {
  compileTime = DateTime(F(__DATE__), F(__TIME__));
  
#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif
