 //I don't like the way this function is written but Arduino doesn't support floats under sprintf
 void printWeather()
 {
-  calcWeather(); //Go calc all the various sensors
+  //calcWeather(); //Go calc all the various sensors
+//Calculates each of the variables that wunderground is expecting
+//void calcWeather()
+//{ //RE INTEGRATED TO SAVE GLOBAL VARIABLE ALLOCATION FOR UNO
+  //Calc winddir
+  int winddir = get_wind_direction();
+
+  //Calc windspeed
+  float windspeedms = get_wind_speed();
+
+  //Calc windgustms
+  //Calc windgustdir
+  //Report the largest windgust today
+//  windgustms = 0;
+//  windgustdir = 0;
+
+  //Calc windspdms_avg2m
+  float temp = 0;
+  for(int i = 0 ; i < 120 ; i++)
+    temp += windspdavg[i];
+  temp /= 120.0;
+  float windspdms_avg2m = temp;
+
+  //Calc winddir_avg2m
+  temp = 0; //Can't use winddir_avg2m because it's an int
+  for(int i = 0 ; i < 120 ; i++)
+    temp += winddiravg[i];
+  temp /= 120;
+  int winddir_avg2m = temp;
+
+  //Calc windgustms_10m
+  //Calc windgustdir_10m
+  //Find the largest windgust in the last 10 minutes
+//  windgustms_10m = 0;
+//  windgustdir_10m = 0;
+  //Step through the 10 minutes  
+//  for(int i = 0; i < 10 ; i++)
+//  {
+//    if(windgust_10m[i] > windgustms_10m)
+//    {
+//      windgustms_10m = windgust_10m[i];
+//      windgustdir_10m = windgustdirection_10m[i];
+//    }
+//  }
+
+  //Calc humidity
+  float humidity = myHumidity.readHumidity();
+  //float temp_h = myHumidity.readTemperature();
+  //Serial.print(" TempH:");
+  //Serial.print(temp_h, 2);
+
+  //Calc tempc from pressure sensor
+  float tempc = myPressure.readTemp();
+  //Serial.print(" TempP:");
+  //Serial.print(tempc, 2);
+
+  //Total rainfall for the day is calculated within the interrupt
+  //Calculate amount of rainfall for the last 60 minutes
+  //Niroshan Stop the gathering hourly rain fall data
+  rainin = 0;  
+  for(int i = 0 ; i < 60 ; i++) //change to 60 mnts 
+    rainin += rainHour[i];
+
+  rainin_5m = 0;  
+  for(int i = 0 ; i < 5 ; i++) //change to 5 mnts 
+    rainin_5m += rain5m[i];
+
+
+  //Calc pressure
+  float pressure = myPressure.readPressure();
+
+  //Calc dewptf
+
+  //Calc light level
+  light_lvl = get_light_level();
+
+  //Calc battery level
+  batt_lvl = get_battery_level();
+
+//} //END OF GO CALC WEATHER FUNCTION
+
+
 
   Serial.println();
   Serial.print(gps.location.lng(), 6);

      gps.encode(ss.read());
  } 
  while (millis() - start < ms);
}


//Calculates each of the variables that wunderground is expecting
void calcWeather()
{
  //Calc winddir
  winddir = get_wind_direction();

  //Calc windspeed
  windspeedms = get_wind_speed();

  //Calc windgustms
  //Calc windgustdir
  //Report the largest windgust today
  windgustms = 0;
  windgustdir = 0;

  //Calc windspdms_avg2m
  float temp = 0;
  for(int i = 0 ; i < 120 ; i++)
    temp += windspdavg[i];
  temp /= 120.0;
  windspdms_avg2m = temp;

  //Calc winddir_avg2m
  temp = 0; //Can't use winddir_avg2m because it's an int
  for(int i = 0 ; i < 120 ; i++)
    temp += winddiravg[i];
  temp /= 120;
  winddir_avg2m = temp;

  //Calc windgustms_10m
  //Calc windgustdir_10m
  //Find the largest windgust in the last 10 minutes
  windgustms_10m = 0;
  windgustdir_10m = 0;
  //Step through the 10 minutes  
  for(int i = 0; i < 10 ; i++)
  {
    if(windgust_10m[i] > windgustms_10m)
    {
      windgustms_10m = windgust_10m[i];
      windgustdir_10m = windgustdirection_10m[i];
    }
  }

  //Calc humidity
  humidity = myHumidity.readHumidity();
  //float temp_h = myHumidity.readTemperature();
  //Serial.print(" TempH:");
  //Serial.print(temp_h, 2);

  //Calc tempf from pressure sensor
  tempf = myPressure.readTemp();
  //Serial.print(" TempP:");
  //Serial.print(tempf, 2);

  //Total rainfall for the day is calculated within the interrupt
  //Calculate amount of rainfall for the last 60 minutes
  //Niroshan Stop the gathering hourly rain fall data
  rainin = 0;  
  for(int i = 0 ; i < 60 ; i++) //change to 60 mnts 
    rainin += rainHour[i];

  rainin_5m = 0;  
  for(int i = 0 ; i < 5 ; i++) //change to 5 mnts 
    rainin_5m += rain5m[i];


  //Calc pressure
  pressure = myPressure.readPressure();

  //Calc dewptf

  //Calc light level
  light_lvl = get_light_level();

  //Calc battery level
  batt_lvl = get_battery_level();

}

//Returns the voltage of the light sensor based on the 3.3V rail

  lcd.clear();
  lcd.print("Temperature (Celsius)");
  lcd.setCursor(0, 2);
  lcd.print(tempc);
  delay(2000);
  
  //Serial.print(",raindailymm=");
