 
 byte windspdavg[120]; //120 bytes to keep track of 2 minute average
 int winddiravg[120]; //120 ints to keep track of 2 minute average
-float windgust_10m[10]; //10 floats to keep track of 10 minute max //Yann: to check if OK
+//float windgust_10m[10]; //10 floats to keep track of 10 minute max //Yann: to check if OK
 volatile float rain5m[5]; //Niroshan 5 float to keep rain data of 5 mnts  //Yann: added volatile
-int windgustdirection_10m[10]; //10 ints to keep track of 10 minute max
+//int windgustdirection_10m[10]; //10 ints to keep track of 10 minute max
 volatile float rainHour[60]; //60 floating numbers to keep track of 60 minutes of rain
 
 //These are all the weather values that wunderground expects:
-int winddir = 0; // [0-360 instantaneous wind direction]
-float windspeedms = 0; // [mph instantaneous wind speed]
-float windgustms = 0; // [mph current wind gust, using software specific time period]
-int windgustdir = 0; // [0-360 using software specific time period]
-float windspdms_avg2m = 0; // [mph 2 minute average wind speed mph]
-int winddir_avg2m = 0; // [0-360 2 minute average wind direction]
-float windgustms_10m = 0; // [mph past 10 minutes wind gust mph ]
-int windgustdir_10m = 0; // [0-360 past 10 minutes wind gust direction]
-float humidity = 0; // [%]
-float tempf = 0; // [temperature F]
+//int winddir = 0; // [0-360 instantaneous wind direction]
+//float windspeedms = 0; // [mph instantaneous wind speed]
+//float windgustms = 0; // [mph current wind gust, using software specific time period]
+//int windgustdir = 0; // [0-360 using software specific time period]
+//float windspdms_avg2m = 0; // [mph 2 minute average wind speed mph]
+//int winddir_avg2m = 0; // [0-360 2 minute average wind direction]
+//float windgustms_10m = 0; // [mph past 10 minutes wind gust mph ]
+//int windgustdir_10m = 0; // [0-360 past 10 minutes wind gust direction]
+//float humidity = 0; // [%]
+//float tempc = 0; // [temperature C]
 float rainin = 0; // [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
 float rainin_5m = 0; // [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
 volatile float dailyrainin = 0; // [rain inches so far today in local time]
 //float baromin = 30.03;// [barom in] - It's hard to calculate baromin locally, do this in the agent
-float pressure = 0;
+//float pressure;
 //float dewptf; // [dewpoint F] - It's hard to calculate dewpoint locally, do this in the agent
 
 float batt_lvl = 11.8; //[analog value from 0 to 1023]

      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

    //if(seconds_2m % 10 == 0) displayArrays(); //For testing

    //Check to see if this is a gust for the minute
//    if(currentSpeed > windgust_10m[minutes_10m])
//    {
//      windgust_10m[minutes_10m] = currentSpeed;
//      windgustdirection_10m[minutes_10m] = currentDirection;
//    }

    //Check to see if this is a gust for the day
//    if(currentSpeed > windgustms)
//    {
//      windgustms = currentSpeed;
//      windgustdir = currentDirection;
//    }
    //Minute loop
    seconds += 10; 
    if(seconds > 59)
