   DHT22.acquire();
   while (DHT22.acquiring());    
     
-  humidity = DHT22.getHumidity();
-  temperature = DHT22.getCelsius(); 
+  sample.humidity = DHT22.getHumidity();
+  sample.temperature = DHT22.getCelsius(); 
 }
 
 void beep(int delay_ms) {

#define CALIBRATE_BTN           D4

ReadingSync rs (INTERVAL_MINS, PRE_HEAT_SECS, Time.now());

SimpleEeprom flash;

union float2bytes {float f; char b[sizeof(float)]; };
int unix_time = 0;
int delay_ms = 0;
int reading_time = 0;
int heating_count=0;
int calibration_count=0;
int stage=0;

      break;
    case rs.SEND_READING:
      {
        sprintf(url, "/iaq/get_reading.php?core_id=%s&temp=%2f&hum=%2f&ozone=%i&chlorine=%i&sewer=%i&dust=%2f&unix_time=%i", Spark.deviceID().c_str(), sample.temperature, sample.humidity, sample.mq131_ozone, sample.mq131_chlorine, sample.tgs2602_sewer, sample.dust_concentration, sample.reading_time);  
        request.path = url;
        http.get(request, response);    
        rs.setReadingSent();
