 
 volatile uint16_t maxSampleValue = 0;
 volatile uint16_t minSampleValue = 65535;
+volatile uint16_t averageSampleValue = 0;
 
 constexpr uint16_t SamplingWindowSize = FHT_N;
 volatile bool samplingWindowFull = false;

#endif

  ++currentSampleIndex;

  if (currentSampleIndex == SamplingWindowSize)
  {

  // Use this initializer (uncomment) if you're using a 1.44" TFT
  tft.initR(ST7735_INITR_144GREENTAB);   // initialize a ST7735S chip, black tab
  tft.fillScreen(ST7735_BLACK);
  tft.setTextWrap(false);
}

void setupADC()
