   Serial.print(humidity);
   Serial.println(" %");
 
-  // fload abs (std::abs) requiere #include <cmath>
-  //double tempDiff = std::abs (currentTemperature - temperature);
-  int tempDiff = abs ((currentTemperature - temperature)*10);
-  temperature = currentTemperature;
-
-  if (tempDiff < 1) {
-    return 1;
-  } else {
-    return 2;
-  }
+  Serial.print("Soil 1 = ");
+  Serial.println(soil1);
 }

    while (1);
  }

  Particle.variable("temperature", &temperature, DOUBLE);
  Particle.variable("pressure", &pressure, DOUBLE);
  Particle.variable("humidity", &humidity, DOUBLE);
}

void loop() {

  phant.add("temp", temperature, 2);
  phant.add("pressure", pressure, 2);
  phant.add("humidity", humidity, 2);
  phant.add("soil1", soil1);

  return phant.particlePost();
}


byte readSensorData() {
  byte status = readBMESensor();

  soil1 = readSoilSensor(soilSensor1);

  // todo define thresholds for dry, wet, max increase/decrease
  // todo integrate the soil sensor value into status
  return status;
}

// read BME280 sensor data
byte readBMESensor() {
  double currentTemperature = 0;
  digitalWrite(led, HIGH);
  currentTemperature = bme.readTemperature();
  pressure = bme.readPressure() / 100.0F;
  altitude = bme.readAltitude(SEALEVELPRESSURE_HPA);
  humidity = bme.readHumidity();
  delay(200);
  digitalWrite(led, LOW);

  // calc temp diff for changes at .x level
  int tempDiff = (currentTemperature - temperature)*10;
  temperature = currentTemperature;

  if (tempDiff > 0) {
    return 1; // indicate temp increase above threshold
  } else if (tempDiff < 0){
    return 2; // indicate temp decrease above threshold
  } else {
    return 0; // indicate normal reading
  }
}

// read soil sensor data
int readSoilSensor(int soilSensor) {
    unsigned int val = 0;
    digitalWrite(led, HIGH);
    digitalWrite(soilPower, HIGH); //turn sensor power on
    delay(10);
    val = analogRead(soilSensor);
    digitalWrite(soilPower, LOW); //turn sensor power off
    delay(190);
    digitalWrite(led, LOW);
    return val;
}

void dumpSerial() {
  Serial.print("Temperature = ");
  Serial.print(temperature);
  Serial.println(" *C");

  Serial.print("Pressure = ");
