 double rmsValue = 0.0;
 double peakValue = 0.0;
 
+#define NUMMEASURE 24
+double twoMinuteMeasurements[NUMMEASURE];
+double twoMinuteAverage = 0.0;
+double twoMinuteSum = 0.0;
+unsigned int MeasurementCounter = 0;
+bool enoughMeasurements = false;
+bool calibrated = false;
+
+unsigned int globalState = 0;
+
 unsigned int debounceInterval = 200;
 unsigned int lastJoystick = 0;
 bool triggeredJoystick = false;

    }
    peakValue = sqrt(value);
    return VTOA * sqrt(sumSquares / (double)samples);
}

void msOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) {

#define OFFSET 8820
#define SCALE (1.65/OFFSET)
#define VTOA (22.0/1.65)

#define TENTHOUSAND 10000.0
double calibrationOffset = 3.867123;

double Volts(int digits)
{
