 
 U8G2_UC1701_MINI12864_F_4W_SW_SPI u8g2(U8G2_R2, 21, 20, 19, 22);
 CTSensor clamp(PIN_CT, CT_CALIBRATION_VALUE);
-
-unsigned long lastDisplayTime = 0;
-double runningTotal = 0;
-int samplesTaken = 0;
-
-unsigned long enableWindowTime = 0;
 
 double mcbTrippedCurrent;
 

  }
  
}

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);

