     lastSensorStatus = currentSensorStatus;
 }
 
-int postToParticle() {
+// post to Particle cloud
+void postToParticle() {
   sprintf(publishString,"{\"status\": %d, \"temp\": %0.2f, \"pressure\": %0.2f, \"humidity\": %0.2f, \"soil1\": %u, \"soil2\": %u, \"soil3\": %u}",
     currentSensorStatus, temperature, pressure, humidity, soil1, soil2, soil3);
   Particle.publish("sensor",publishString);
-  return 1;
 }
 
+// post to SparkFun phant cloud storage
 int postToPhant() {
-  // add variables
   phant.add("status", currentSensorStatus);
   phant.add("temp", temperature, 2);
   phant.add("pressure", pressure, 2);

    if (lastMeasurement > MEASUREMENT_RATE) {
      int bmeSensorStatus = readBMESensor();
      delay(200);
      int soil1SensorStatus = readSoilSensor(soilSensor1, soil1);
      delay(200);
      int soil2SensorStatus = readSoilSensor(soilSensor2, soil2);
      delay(200);
      int soil3SensorStatus = readSoilSensor(soilSensor3, soil3);

      // calc overall sensor status
      currentSensorStatus = (bmeSensorStatus << 6) + (soil1SensorStatus << 4) +

// moisture sensor
const int soildThresholdLow = 500;
const int soildThresholdHigh = 3500;
struct SoilSensor {
  int sensor;
  int power;
};
SoilSensor soilSensors[3] = {{ A0, D4 }, { A1, D5 }, { A2, D6 }};
int soil1 = 2048, soil2 = 2048, soil3 = 2048;

// SparkFun phant library
