| Posted: 10:16am 13 Mar 2012 |
|
|
|
What I was asking if both forumulas "matched" in format the formuluas by sparkfun and by Bosch?
The weather algorithm produced 0 differential? Looking at the weather calculation, I had to insert a "fixed" value for the altitude and replaced BMP085_Pa with the pressure at sea level eg 101325 Pa. by doing so, the "epressure_Pa" seems to always stay around at 101325. The formula seems "not to change" but it gives the needed diff. "leg" for the epressure_Pa difference.
SUB cal_Weather
' algorithm fix - the differential was always zero because the altitude was variable not fixed.
' epressure calculation should have sealevel Pa!
Local ePressure_Pa, weatherDiff, BMP085_Pa, cal_constant, fixed_user_altitude_M
cal_BMP085_Pressure ' get pressure (in millibars/hectorPascals)
'cal_Altitude <--- do not use - for ref. only
fixed_user_altitude_M = 273.1 ' <-----<<<<< Local user altitude in meters
cal_constant = 0 ' 0 millibars - for calbibration if needed.
ePressure_Pa = 101325 * (1.0 - ((fixed_user_altitude_M / 44330)^ 5.255)) ' In meters and Pascals
BMP085_Pa = (BMP085_P - cal_constant) * 100 ' Convert to Pascals with cal constant
weatherDiff = BMP085_Pa - ePressure_pa
? "BMP085 Weather BMP085_Pa = ",BMP085_Pa
? "BMP085 Weather ePressure Pa = ",ePressure_Pa
? "BMP085 Weather Diff. Pa = ",weatherDiff
if(weatherDiff > 250) then
?"Sunny!"
ELSEIF ((weatherDiff <= 250) OR (weatherDiff >= -250)) THEN
?"Partly Cloudy"
ELSEIF if (weatherDiff > -250) THEN
?"Rain"
ENDIF
END SUB
Are you struggling with free memory?
Yes, but the workaround is to run "blocks of code" from the SD drive which has 16 GB. Edited by DuinoMiteMegaAn 2012-03-14 |