Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.

BMP388 library code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BMP388 library code

by LozK on Wed Jun 12, 2019 9:28 am

I got some Adafruit BMP388 breakout boards and was looking at the library code for use with Arduinos and similar (

It seems that the Adafruit library uncomments BMP3_DOUBLE_PRECISION_COMPENSATION, resulting it being defined and therefore making the choice to use the double precision floating point versions of the (temperature and pressure) compensation functions.

The original code from Bosch defaults to using the integer-based versions of the functions (that definition is commented out), as mentioned in the comments here (at "Regarding Compensation functions...": and as shown on line 119 of the _defs.h file, here: ... mp3_defs.h

So I was wondering was there a reason for using the floating point versions, especially as (if I recall correctly) the Arduino environment doesn't allow for the use of double precision floating points, only 32-bit floats (so it might lead to less accuracy int he final readings)?

I was just trying to understand the code and the reasons for choosing the floating point-based calculation path, as I need to get as much accuracy out of these sensors as possible (trying to measure small, flow-induced pressure differences around a room).

Thank you for any advice you can give.

Posts: 2
Joined: Wed Jun 13, 2018 7:22 am

Please be positive and constructive with your questions and comments.