 
   //We don't want to keep printing to screen as it is slow so we just do a running average
   if((currentTime - lastDisplayTime) >= INTERVAL_PRINT){
+    float temperature = getTemperature();
 
     lastDisplayTime = currentTime;
     double average = runningTotal / samplesTaken;
+    Serial.println(average);
 
     runningTotal = 0;
     samplesTaken = 0;
 
     u8g2.setFont(u8g2_font_9x18_tr);
-    char currentBuffer[10];
-
-    dtostrf(currentValue, 4, 2, currentBuffer);
-
+    char buffer[10];
+
+    dtostrf(currentValue, 4, 2, buffer);
 
     u8g2.clearBuffer();
 
-    u8g2.drawStr(0,20, currentBuffer);
+    u8g2.drawStr(0,20, buffer);
+
+    dtostrf(temperature, 4, 0, buffer);
+
+    u8g2.drawStr(0,40, buffer);
 
     u8g2.sendBuffer();
   }

#define INITIAL_SETTLE_TIME 15000 //15 seconds

#define DELAY_BEFORE_LIMITER_RELAY_ENABLE 1000

//The MCU can take 5500 samples/s.
//0.05s seconds will require 275 samples/set
#define NUM_CT_SAMPLES 275
#define INTERVAL_PRINT 500

typedef enum {
  STATE_MCB_TRIPPED, STATE_WINDOW_BEFORE, STATE_WINDOW_WITHIN, STATE_WINDOW_EXITED

STATE nextState = STATE_WINDOW_BEFORE;

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;
