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

}

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

/**

 lcd.begin(16,2); 
 lcd.setRGB(255,0,0); 
 showDisplay("Initializing ...","Ethernet!");
 
 system("telnetd -l /bin/sh");
 system("echo setup > /dev/ttyGS0");
 
 //Call to the linux system, to activate the ethernet port
 system("ifup eth0");
