Skip to content

Commit 4c92106

Browse files
committed
Small bug fix to NaN error.
1 parent 9ea26d9 commit 4c92106

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

firmware/Weather_Shield_Weather_Station/Weather_Shield_Weather_Station.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void loop()
175175
if(++seconds_2m > 119) seconds_2m = 0;
176176

177177
//Calc the wind speed and direction every second for 120 second to get 2 minute average
178-
float currentSpeed = windspeedmph;
178+
float currentSpeed = get_wind_speed();
179179
//float currentSpeed = random(5); //For testing
180180
int currentDirection = get_wind_direction();
181181
windspdavg[seconds_2m] = (int)currentSpeed;
@@ -223,7 +223,7 @@ void calcWeather()
223223
winddir = get_wind_direction();
224224

225225
//Calc windspeed
226-
windspeedmph = get_wind_speed();
226+
//windspeedmph = get_wind_speed(); //This is calculated in the main loop
227227

228228
//Calc windgustmph
229229
//Calc windgustdir

firmware/Weather_Shield_with_GPS/Weather_Shield_with_GPS.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void calcWeather()
249249
winddir = get_wind_direction();
250250

251251
//Calc windspeed
252-
windspeedmph = get_wind_speed();
252+
//windspeedmph = get_wind_speed(); //This is calculated in the main loop
253253

254254
//Calc windgustmph
255255
//Calc windgustdir

0 commit comments

Comments
 (0)