 
   if(currentState != STATE_WINDOW_EXITED){
     currentState = STATE_WINDOW_EXITED;
+    changeDisplayBacklight(true);
     Serial.println("Exited window, bypass resistor");
     shortBeepXTimes(1);
   }

  }
  
}

void longBeep(){
  digitalWrite(PIN_BUZZER, HIGH);
  delay(BUZZER_LONG_BEEP_TIME);
  digitalWrite(PIN_BUZZER, LOW);
}


    mcbTrippedCurrent = currentValue;
    Serial.print("MCB tripped at: ");
    Serial.println(mcbTrippedCurrent);

    initialWarningTriggered = true;
    initialWarningStart = currentTime;
    digitalWrite(PIN_BUZZER, HIGH);
  }

  //This is to sound the buzzer and blink the Backlight for BACKLIGHT_BLINK_RATE duration 
  if(initialWarningTriggered){

    static bool displayBacklightCurrentlyOn = false;
    static unsigned long displayBacklightLastChanged = 0;

    if((currentTime - displayBacklightLastChanged) > BACKLIGHT_BLINK_RATE){
      displayBacklightLastChanged = currentTime;
      displayBacklightCurrentlyOn = !displayBacklightCurrentlyOn;
      changeDisplayBacklight(displayBacklightCurrentlyOn);
    }


    if((currentTime - initialWarningStart) > BUZZER_LONG_BEEP_TIME){
      initialWarningTriggered = false;
      digitalWrite(PIN_BUZZER, LOW);
      changeDisplayBacklight(true);
       
    }
    
  }

 

  int buttonPressed = digitalRead(PIN_BUTTON_ENTER);

