         // Read weather measurements from device
         if (event.pressure)
         {
-            BMP180Pressure = event.pressure;
+            bufferPressure = event.pressure;
+            /* The pressure is initially loaded into a buffer variable */
+            /* We load it into the published variable this way to be compatible with the Spark.variable data types*/
+            BMP180Pressure = bufferPressure;
 
             /* First we get the current temperature from the BMP085 */
-            bmp180.getTemperature(&BMP180Temperature);
+            bmp180.getTemperature(&bufferTemperature);
+            /* The temperature is initially loaded into a buffer variable */
+            /* We load it into the published variable this way to be compatible with the Spark.variable data types*/
+            BMP180Temperature = bufferTemperature;
 
             /* Then convert the atmospheric pressure, SLP and temp to altitude */
             /* Update this next line with the current SLP for better results */
             float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;
-            BMP180Altitude = bmp180.pressureToAltitude(seaLevelPressure, BMP180Pressure, BMP180Temperature);
+            BMP180Altitude = bmp180.pressureToAltitude(seaLevelPressure, bufferPressure, bufferTemperature);
         }
     }
 

double POWR3V = 0; //Watts

int SOILT = A4;
float SOILTV = 0; //Celsius: Temperature (C) = Vout*41.67-40 :: Temperature (F) = Vout*75.006-40

int SOILH = A5;
float SOILHV = 0; //Volumetric Water Content (VWC): http://www.vegetronix.com/TechInfo/How-To-Measure-VWC.phtml

bool BMP180OK = false;
float BMP180Pressure = 0; //hPa
float BMP180Temperature = 0; //Celsius
float BMP180Altitude = 0; //Meters

bool Si7020OK = false;
float Si7020Temperature = 0; //Celsius
float Si7020Humidity = 0; //%Relative Humidity

bool Si1132OK = false;
float Si1132UVIndex = 0; //UV Index scoring is as follows: 1-2  -> Low, 3-5  -> Moderate, 6-7  -> High, 8-10 -> Very High, 11+  -> Extreme
float Si1132Visible = 0; //Lux
float Si1132InfraRd = 0; //Lux

bool ACCELOK = false;
int16_t ax, ay, az, gx, gy, gz;

//********************************************************************************
//********************************************************************************

int SENSORDELAY = 3000; // milliseconds (runs x1)
int EVENTSDELAY = 1000; // milliseconds (runs x10)
int OTAUPDDELAY = 7000; // milliseconds (runs x1)
int SLEEP_DELAY = 0; // 40 seconds (runs x1) - should get about 24 hours on 2100mAH, 0 to disable and use RELAX_DELAY instead
String SLEEP_DELAY_MIN = "15"; // seconds - easier to store as string then convert to int
String SLEEP_DELAY_STATUS = "OK"; // always OK to start with
int RELAX_DELAY = 10; // seconds (runs x1) - no power impact, just idle/relaxing

// Variables for the I2C scan
byte I2CERR, I2CADR;

//********************************************************************************
//********************************************************************************
//********************************************************************************

int I2CEN = D2;
int ALGEN = D3;
