 uint8_t raw_d = 0x5E;
 uint8_t dot_bit = 0x80;
 
-RTC_DS1307 RTC;
+RTC_DS3231 RTC;
 unsigned long synchronized_clock_millis;
 ClockTime synchronized_clock_time;
 ClockTime current_clock_time;

  if (!alarmActive)
  {
    setColorForSunRise();
    alarmStartMillis = millis();
    alarmActive = true;
  }
  if (seconds >= thirtyminutes) {
    linearBrightOfStep(totalDimmerSteps);
    return;
  }
  linearBrightOfMilliseconds(millis()-alarmStartMillis);
}



}

unsigned long alarmStartMillis = 0;
const unsigned lightUpdateInterval = 50;
unsigned long lastLightUpdate = millis();
void updateLight() {
  if (!isTimeNow(lastLightUpdate,lightUpdateInterval)) {
    return;
  }
  if (digitalRead(AlarmEnabledSwitch) == LOW) return;
  ClockTime current = current_clock_time;
  int32_t seconds = secondsBtwDates(current,startTime);
  if ((seconds < 0) || (seconds >= maxTime)) {
