 
 /////////////////////////////////////////////////////////////////////////////
 // resource management stuff ////////////////////////////////////////////////
-byte loopCounter = 0;
-const byte TICK_WIFI_DEBUG = 0;
-const byte TICK_HEAP_DEBUG = 0;
+int loopCounter = 0;
+const int LOOP_ROLLOVER = 1000; // how many loops per action slice
+const byte TICK_MONITOR = 0;
+const byte TICK_WIFI_DEBUG = 500;
 const byte TICK_POST_DEBUG = 200;
-const byte TICK_MONITOR = 100;
+const byte TICK_HEAP_DEBUG = 1000;
 
 /////////////////////////////////////////////////////////////////////////////
 // wifi management stuff ////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// sensor/actuator stuff ////////////////////////////////////////////////////
void startPeripherals() {
  Serial.println("StartPeripherals");
  mySwitch.enableTransmit(13);   // RC Transmitter is connected to Pin #13

  tempSensor.begin();     // Start the onewire temperature sensor
  if(tempSensor.getDeviceCount()==1) {
    GOT_TEMP_SENSOR = true;
    tempSensor.getAddress(tempAddr, 0);
    tempSensor.setResolution(tempAddr, 12);    // set the resolution to 12 bit (DS18B20 goes from 9-12 bit)
  }
  
  dht.begin();    // Start the humidity and air temperature sensor
  float airHumid = dht.readHumidity();
  float airCelsius = dht.readTemperature();
  if (isnan(airHumid) || isnan(airCelsius)) {
    Serial.println("Failed to find Humidity sensor!");
  } else {
    GOT_HUMID_SENSOR = true;
  }

    Serial.println("Found pH sensor");
  }
}
void updateSensorData(monitor_t *monitorData) {
  // Serial.print("monitorCursor = "); Serial.print(monitorCursor);
  // Serial.print(" monitorSize = ");  Serial.println(monitorSize);
