 #define LED 8
 #define LIGHT_SENSOR 0
 #define TEMP_SENSOR 1
-
-#define THERMISTOR_VALUE 3975;
 
 // json elements to determin if the LED is on or off
 const String LED_ON = "\"led\":\"ON\"";

}

/**
  Calculates the Temperature for a Grove light sensor, according to http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor .
**/
float calcTemperature() {
 int sensorData = analogRead(TEMP_SENSOR);
 int B = THERMISTOR_VALUE;
 float resistance = (float)(1023-sensorData)*10000/sensorData; //Calculate resistance of the sensor
 float temperature = 1/(log(resistance/10000)/B+1/298.15)-273.15;
 return temperature;
}

/**
  Calculates the Temperature for a Grove temperature sensor, according to http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor .
**/
float getLightResistance() {
  int sensorData = analogRead(LIGHT_SENSOR);
  float resistance = (float)(1023-sensorData)*10/sensorData;
  return (float)sensorData;
}

/**

   sens.data.led = "OFF";
  }
  //Update the Temperature and the Light Resistance
  sens.data.temperature = calculateTemperature();
  sens.data.brightness = calculateLightSensorResistance();
  
  //write the generated json data to the client
  Serial.print(sens.toJson());
