 
 // Main Application Structure
 typedef struct ApplicationStruct {
-  byte nbrSensor;
-  SensorDefinition sensors[2]; // Sensors Definition
+  byte nbrSensors;
+  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
 } ApplicationDefinition;
 
 // Static Definition
 ApplicationDefinition _app = {
-  2, // Total number of sensors
+  3, // Total number of sensors
   // Sensors
   {
     // Sensor #1

#define D6_pin 6
#define D7_pin 7

#define BACKLIGHT_DURATION 10000

// Pin Configuration
#define rxLed 13
#define rxPin 11
#define touchCommonPin 2
#define touchSensPin 4


//
void updateLocalSensors()
{
  // Get time
  unsigned long currentTime = millis();

  // Check if we have to update the main sensor
  if(currentTime - _app.lastMainSensorUpdated > MAIN_SENSOR_UPDATE)
  {
    Serial.println("Update Local Sensor");

    _app.lastMainSensorUpdated = currentTime;

    float buffer;

    // Read Temp sensor
    _mainSensor.getTemperature(&buffer);

    // Notify new Value
    fireNewSensorValue(0,buffer);

    // Read Pressure sensor (in Pa)
    _mainSensor.getPressure(&buffer);

    // Notify new Value (in hPa)
    fireNewSensorValue(1,buffer/100);

  }
}

