Skip to content

Commit cb2b3de

Browse files
authored
Fixing output for windspeedmph
Adding line of code at 178: windspeedmph = currentSpeed;//update global variable for windspeed when using the printWeather() function and added comment to line 227 to explain why the calculation was commented out: //windspeedmph = get_wind_speed(); //This is calculated in the main loop on line 179 to fix this issue => #24
1 parent d09a0d8 commit cb2b3de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firmware/Weather_Shield_Weather_Station/Weather_Shield_Weather_Station.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ void loop()
176176

177177
//Calc the wind speed and direction every second for 120 second to get 2 minute average
178178
float currentSpeed = get_wind_speed();
179+
windspeedmph = currentSpeed;//update global variable for windspeed when using the printWeather() function
179180
//float currentSpeed = random(5); //For testing
180181
int currentDirection = get_wind_direction();
181182
windspdavg[seconds_2m] = (int)currentSpeed;
@@ -223,7 +224,7 @@ void calcWeather()
223224
winddir = get_wind_direction();
224225

225226
//Calc windspeed
226-
//windspeedmph = get_wind_speed(); //This is calculated in the main loop
227+
//windspeedmph = get_wind_speed(); //This is calculated in the main loop on line 179
227228

228229
//Calc windgustmph
229230
//Calc windgustdir

0 commit comments

Comments
 (0)