 double pressure = 0;
 double altitude = 0;
 double humidity = 0;
+const double TEMPERATURE_THRESHOLD_LOW = 0; // used for alerts if temp is blow this value
 
 // moisture sensor
-const int soildThresholdLow = 500;
-const int soildThresholdHigh = 3500;
+const int SOIL_THRESHOLD_LOW = 500;
+const int SOIL_THRESHOLD_HIGH = 3500;
 struct SoilSensor {
   int sensor;
   int power;


// interval counters for measurement and post
const unsigned int MEASUREMENT_RATE = 60000; // read sensor data every 60 sec
const unsigned int POST_RATE = 15 * 60000; // post data every 15 minutes
elapsedMillis lastMeasurement;
elapsedMillis lastPost;

void setup() {
  Serial.begin(9600);

  pinMode(led, OUTPUT);
  for (unsigned int i = 0; i < sizeof(soilSensors); i++) {

  Particle.publish("sensor",publishString);
}

// post to Particle cloud
void postSoilEventToParticle() {
  if (soil1 < SOIL_THRESHOLD_LOW) {
    Particle.publish("plant_alert", "1");
  }
  if (soil2 < SOIL_THRESHOLD_LOW) {
    Particle.publish("plant_alert", "2");
  }
  if (soil3 < SOIL_THRESHOLD_LOW) {
    Particle.publish("plant_alert", "3");
  }
}

void postBMEEventToParticle() {
  if (temperature < TEMPERATURE_THRESHOLD_LOW) {
    sprintf(eventString, "%0.2f °C", temperature);
    Particle.publish("temp_alert", eventString);
  }
}

// post to SparkFun phant cloud storage
int postToPhant() {
  phant.add("status", currentSensorStatus);
