 /*
 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

    sensorReadings();
    
    // React on sensor values
    reactAirTemperature();
    reactLight();
    reactMoisture();
    
    
    
    
  
  }
  
  digitalWrite(ledPin, LOW);
  
  if (bluetooth.find("t")) {
    int data = bluetooth.parseInt();
    setGoodAirTemperature(data);
  }
  if (bluetooth.find("w")) {
    int data = bluetooth.parseInt();
    setGoodSoilMoisture(data);
  }
  if (bluetooth.find("l")) {
    int data = bluetooth.parseInt();
    setGoodLDRValue(data);
  }
  
  if (bluetooth.find("m")) {
    int data = bluetooth.parseInt();
    if (data == 0)
    {
      autoAirTemperature = false;
    }
    if (data == 1)
    {
      autoLight = false;
    }
    if (data == 2)
    {
      autoMoisture = false;
    }
  }
  if (bluetooth.find("a")) {
    int data = bluetooth.parseInt();
    if (data == 0)
    {
      autoAirTemperature = true;
    }
    if (data == 1)
    {
      autoLight = true;
    }
    if (data == 2)
    {
      autoMoisture = true;
    }
  }
  

