 
 void PushedAnyButton()
 {
-	BacklightForButtonPress();
 	if (alarmActive)
 	{
 		alarmActive = false;
 		brightness = 0;
 		SetBrightness(brightness);
+	}
+}
+
+void CheckDayOrNight() {
+	if ((hour > 20) || (hour >= 0 && hour < 6))
+	{
+		isNight = true;
+	}
+	else
+	{
+		isNight = false;
+	}
+}
+
+bool HourStart() {
+	if (second == 0)
+	{
+		if (minute == 0)
+		{
+			return true;
+		}
+	}
+	return false;
+}
+
+void AdjustSettingsForSleepTimeAt(int hourToSwitchToSleepMode) {
+	if (hour == hourToSwitchToSleepMode)
+	{
+		backlightManuallyTurnedOff = true;
+		brightness = 0;
+		SetBrightness(brightness);
+		activeLED = LEDStrip12V;
 	}
 }
 

{
	alarmOn = !alarmOn;
	RefreshLCD();
}

void BacklightForButtonPress()
{
	backlightOnForButton = true;
	pushedButtonAt = millis();
}

void ChangeBrightness(int step) {

{
	Wire.begin();
	irrecv.enableIRIn();
	pinMode(backlightLCD, OUTPUT);
	pinMode(LEDStrip12V, OUTPUT);
	pinMode(LEDStrip6V, OUTPUT);

	lcd.createChar(0, sunCharacter);
	lcd.begin(16, 2);
