 }
 
 // read soil sensor data
-int readSoilSensor(int soilSensor, int &soilValue) {
+int readSoilSensor(const int soilSensor, const int soilSensorPower, int &soilValue) {
     digitalWrite(led, HIGH);
-    digitalWrite(soilPower, HIGH); //turn sensor power on
+    digitalWrite(soilSensorPower, HIGH); //turn sensor power on
     delay(10); // give some time to settle
     soilValue = analogRead(soilSensor);
-    digitalWrite(soilPower, LOW); //turn sensor power off
+    digitalWrite(soilSensorPower, LOW); //turn sensor power off
     delay(190);
     digitalWrite(led, LOW);
 

    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
