 /*
 Arduino based self regulating kitchen garden
- 
- */
+Created by: Jamie Neubert Pedersen
+version: 1.0
+*/
 #include <DHT.h>
 #include <SoftwareSerial.h>
 #include <Sensirion.h>

float soilTemperature = 0;
float soilMoisture = 0;
float dewpoint;
float goodSoilTemperature = 25;

// air temperature related setup
#define DHTPIN 2        // Humidity and temperature sensor pin for DHT22

  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);
    }
}
