   char status;
   if(bmp180Temperature(T)) {
     Serial.println(T);
-    delay(500);
     status = pressure.startPressure(3);
     if (status != 0) {
         delay(status);

// temps entre actualitzacions de els elements
// [lm35_1, lm35_2, ldr_1]
#include <Wire.h>
#include <SFE_BMP180.h>

#define count(x) sizeof(x)/sizeof(unsigned long)
#define groundPin A0
#define ALTITUDE 570

#define BMP180T 0   // Temperature
#define BMP180P 1   // Pressure

#define NOTUSED -1  // For BMP180 sensor.

SFE_BMP180 pressure;

int types[] = {BMP180T,BMP180P};
unsigned long lastUpdate[] = {0,0};
unsigned long updateTimes[] = {30000,60000};
int pins[] = {NOTUSED,NOTUSED};

int secureAnalogRead(int pin) {
  delay(0.01);
  analogRead(groundPin);
  delay(0.01);
  return analogRead(pin);
  
}

  String c, v;
  switch (type) {
    case BMP180T:
      {
      double t;
      c = "BMP180T";
      if (bmp180Temperature(t)) v = String(t);
      else v = c + " Error";
      break;
      }

    case BMP180P:
      {
      double p;
      c = "BMP180P";
      if (bmp180Pressure(p)) v = String(p);
      else v = c + " Error";
      break;
      }

    case DHT22T:
      {
      float t = dht.readTemperature();    // Default temperature unit is ºC.
      c = "DHT22T";
      v = String(t);
      break;
      }

    case DHT22H:
      {
      float h = dht.readHumidity();
      c = "DHT22H";
      v = String(h);
      break;
      }
    case DHT22HI:
      {
      float h, t, hi;
      h = dht.readHumidity();
      t = dht.readTemperature(true);    // We need value in farenheit.
      hi = dht.computeHeatIndex(t,h);
      c = "DHT22HI";
      v = String(dht.convertFtoC(hi));
      break;
      }
  }
  sendCommand(c, v);
}
