 float soilTemperature = 0;
 float soilMoisture = 0;
 float dewpoint;
-float goodSoilTemperature = 25;
+float goodSoilMoisture = 70;
 
 // air temperature related setup
 #define DHTPIN 2        // Humidity and temperature sensor pin for DHT22

    sensorReadings();
    
    // React on sensor values
    if (airTemperature > goodAirTemperature) // activate fan to cool when the temperature is above the defined good temperature in degrees Celsius
    { 
      digitalWrite(relayPin1, LOW);
    } 
    else 
    {
      digitalWrite(relayPin1, HIGH);
    }
    
    if (LDRValue < goodLDRValue) // activate relay 2 when the light intensity is below the defined good light intensity
    {
      digitalWrite(relayPin2, LOW);
    }
    else
    {
      digitalWrite(relayPin2, HIGH);
    }
  
  }
  
  digitalWrite(ledPin, LOW);
  
  if (bluetooth.find("c")) {
    int data = bluetooth.parseInt();
    
    Serial.print("Received: ");
    Serial.println(data);
  }
  


  goodAirTemperature = value;
}

void setGoodSoilMoisture(float value) {
  goodSoilMoisture = value;
}

void setGoodLDRValue(float value) {
  goodLDRValue = value;
}

void reactAirTemperature() {
  if (autoAirTemperature == false)
  {
    return;
  }
  if (airTemperature > goodAirTemperature) // activate fan to cool when the temperature is above the defined good temperature in degrees Celsius
    { 
      digitalWrite(relayPin1, LOW);
    } 
    else 
    {
      digitalWrite(relayPin1, HIGH);
    }
}

void reactLight() {
  if (autoLight == false)
  {
    return;
  }
  if (LDRValue < goodLDRValue) // activate relay 2 when the light intensity is below the defined good light intensity
    {
      digitalWrite(relayPin2, LOW);
    }
    else
    {
      digitalWrite(relayPin2, HIGH);
    }
}

void reactMoisture() {
  if (autoMoisture == false)
  {
    return;
  }
  if (soilMoisture < goodSoilMoisture) // activate relay 2 when the light intensity is below the defined good light intensity
    {
      digitalWrite(relayPin3, LOW);
    }
    else
    {
      digitalWrite(relayPin3, HIGH);
    }
}
