I should really work these into the Adafruit drivers, but I always cringe whenever I touch them now since so many people depend on these files.
But here are some helper functions I wrote for pressure sensors for myself that you may find useful.
It should be possible to move them over to Python without too much effort: https://github.com/microbuilder/LPC11U_ ... pressure.c
- Convert barometric pressure to altitude
- Calculate sea level pressure from barometric pressure at a known altitude
- Calculate the estimated temperature at a given altitude
- Calculate the barometric pressure at a given altitude
Note: Pressure is in hPa, temperature is in C and altitude is in m