| Posted: 02:20pm 13 Mar 2012 |
|
|
|
Weather calculation
This code snippet is still wrong!
ePressure_Pa = 101325 * (1.0 - ((fixed_user_altitude_M / 44330)^ 5.255))
Sparkfun weather calculation.
ePressure_Pa = 101325 * (1 - fixed_user_altitude_M / 44330)^ 5.255 ' In meters and Pascals
The formula recomputes what the barometric pressure should be at a given elevation.
At sea level (101325 Pa) the elevation is 0 meters so the ref. is 101325 Pa.
At higher elevations the pressure decreases so at my elevation (273.1 meters) the calculated air pressure reference (for weather) is 98087.409 Pa.
Using the above calcuation they read the present barometric pressure to get the difference between the two values to compute the projected weather. <----- very cool
So the correct weather formula is
ePressure_Pa = 101325 * (1 - fixed_user_altitude_M / 44330)^ 5.255 ' In meters and Pascals
|