     Serial.println("Found pH sensor");
   }
 }
-void updateSensorData(monitor_t *monitorData) {
-  // Serial.print("monitorCursor = "); Serial.print(monitorCursor);
-  // Serial.print(" monitorSize = ");  Serial.println(monitorSize);
-
-  monitor_t* now = &monitorData[monitorCursor];
-  if(monitorSize < MONITOR_POINTS)
-    monitorSize++;
-  now->timestamp = millis();
-  if(GOT_TEMP_SENSOR) {
-    getTemperature(&now->waterCelsius);
-    // TODO yeild();
-  }
-  if(GOT_HUMID_SENSOR) {
-    getHumidity(&now->airCelsius, &now->airHumid);
-    // TODO yeild();
-  }
-  if(GOT_LIGHT_SENSOR) {
-    getLight(&now->lux);
-    // TODO yeild();
-  }
-  if(GOT_PH_SENSOR) {
-    getPH(&now->pH);
-    // TODO yeild();
-  }
-  if(GOT_LEVEL_SENSOR) {
-    getLevel(LEVEL_ECHO_PIN1, &now->waterLevel1);
-    getLevel(LEVEL_ECHO_PIN2, &now->waterLevel2);
-    getLevel(LEVEL_ECHO_PIN3, &now->waterLevel3);
-    // TODO yeild();
-  }
-    
-  if(SEND_DATA) postSensorData(&monitorData[monitorCursor]);
-    
-  if(++monitorCursor == MONITOR_POINTS)
-    monitorCursor = 0;
-}
 void postSensorData(monitor_t *monitorData) {
   //Serial.println("\npostSensorData");
 

  dnsServer.processNextRequest();
  webServer.handleClient();

  if(loopCounter == TICK_MONITOR) {
    updateSensorData(monitorData);
    // TODO yeild() here?
    // TODO pump logic
    delay(500); // TODO a better way?!
  } 
  if(loopCounter == TICK_WIFI_DEBUG) {
    Serial.print("SSID: "); Serial.print(apSSID);
    Serial.print("; IP address(es): local="); Serial.print(WiFi.localIP());

  long waterLevel1;
  long waterLevel2;
  long waterLevel3;
} monitor_t;
monitor_t monitorData[MONITOR_POINTS];
int monitorCursor = 0;
int monitorSize = 0;
