Bosch BMP085 Barometer FP Pres. Cal.


Author Message
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 04:26am 13 Mar 2012      

  DuinoMiteMegaAn said   @BobD - Thanks for the reduced code algorithm for 2's complement. That got me
over the hump until I "hit the wall" with the two complex formulas for altitude and weather calculations.


altitude
BMP085_altitude_M = 44330 * (1.0 - ((Pres_x /sealevel_pres)^ 0.190294957184))


weather
ePressure_Pa = BMP085_Pa * (1.0 - ((BMP085_altitude_M / 44330)^ 5.255))


See anything obvious that is wrong?
Ref. Sparkfun Device BMP085 (quickstart tutorial)

Andy
I wouldn't have thought that the revised TC stuff was over the hump material. Are you struggling with free memory?

What problems do you have now?

The exponent in the altitude calculation may run into loss of accuracy problems. It will probably get truncated. I would be inclined to use 0.1903 instead. Just looked at your code and you are already there. I'm no help there.

If you need a way to look at your intermediate results you could try this bit of code
SUB Wait
? +++++++++++++++++++++
? ' print any variables that may be important
? " Press any key to continue > ";
DO
LOOP UNTIL INKEY$ <> ""
END SUB

when you want to use it just include a WAIT in your program and edit the SUB to print the variables. The ++++++s are just used as markers to indicate that it is not usual program output. They can be left out.