   
   //
   // Send value to Web Server
-  
-  // Convert to String
-  sprintf(_app.url, "%d/", sensorID);
-
-  // Convert Float to String
-  char newValueString[10];
-  dtostrf(newValue, 2, 2, newValueString);
-  
-  strcat(_app.url,newValueString);
-  
-  Serial.print(F("Full path = "));Serial.println(_app.url);
-  
-  
-  _app.isHttpRequest = true;
-  
-   ether.browseUrl(PSTR("/cakephp/points/add/"), _app.url, PSTR("TTKSERVER"), requestUrlCallback);
-  
- 
-  //
-  // Wait end of HTTP Request
-  while(_app.isHttpRequest)
-  {
-      word len = ether.packetReceive();
-      word pos = ether.packetLoop(len);
-      //checkEthernet();
-  }
-  
-  Serial.println(F("End Of Request"));
-  
-  // Workaround to clean Ethernet ...
-  for(int i=0;i<100;i++)
-  {
-    word len = ether.packetReceive();
-    word pos = ether.packetLoop(len);
-  }
+  sendDataToWebServer(sensorID, newValue);
 }
 
 

  SensorDefinition sensors[3]; // Sensors Definition
  RenderDefinition render; // LCD rendering
  ReceiverDefinition rx; // RX receiver
  unsigned long lastTouched; // Last Touched time
  unsigned long lastMainSensorUpdated; // Last time that the main sensor was updated
  char url[20];
  volatile boolean isHttpRequest; // true during HTTP request
} ApplicationDefinition;

// Static Definition
ApplicationDefinition _app = {
  3, // Total number of sensors
  // Sensors
  {

// Main sensor update
#define MAIN_SENSOR_UPDATE 60000

// Timeout for HTTP Request
#define HTTP_TIMEOUT 1000

// Touched
CapacitiveSensor _touch = CapacitiveSensor(touchCommonPin,touchSensPin); 

