0

Adafruit BMP085 library use questions
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit BMP085 library use questions

by William2015 on Sat Feb 09, 2019 6:24 pm

On a Trinket I'm using a tinyBMP085 modification of the Adafruit BMP085 library which is designed to be compatible with the Adafruit library. What's the required line of code to set the BMP085's oversampling/accuracy mode (ultra low power, standard, high resolution, ultra high resolution) from within a sketch?

Also, when for example this line of code is executed:

altitude = bmp.readAltitude();

is there a delay of a length depending upon the oversampling mode setting before a value is actually assigned to "altitude" and the sketch execution proceeds to the next line of code?

William2015
 
Posts: 18
Joined: Sat Oct 10, 2015 1:37 pm

Re: Adafruit BMP085 library use questions

by William2015 on Sun Feb 10, 2019 2:59 pm

William2015 wrote:On a Trinket I'm using a tinyBMP085 modification of the Adafruit BMP085 library which is designed to be compatible with the Adafruit library. What's the required line of code to set the BMP085's oversampling/accuracy mode (ultra low power, standard, high resolution, ultra high resolution) from within a sketch?

Perhaps an answer to my first question - not within the sketch, but make this change within tinyBMP085.h to chose my desired STANDARD oversampling mode?:

class tinyBMP085 {
public:
tinyBMP085();
//uint8_t begin(uint8_t mode = BMP085_ULTRAHIGHRES); // by default go ULTRAHIRES mode
uint8_t begin(uint8_t mode = BMP085_STANDARD);

Also, when for example this line of code is executed:

altitude = bmp.readAltitude();

is there a delay of a length depending upon the oversampling mode setting before a value is actually assigned to "altitude" and the sketch execution proceeds to the next line of code?

Yes. I found this in tinyBMP085.cpp:

else if (oversampling == BMP085_STANDARD)
_delay_ms(8);

William2015
 
Posts: 18
Joined: Sat Oct 10, 2015 1:37 pm

Re: Adafruit BMP085 library use questions

by adafruit_support_carter on Sun Feb 10, 2019 3:19 pm

Looks like you figured it out. Mode is set when calling begin:
https://github.com/adafruit/Adafruit_BM ... 5_U.h#L104

adafruit_support_carter
 
Posts: 11091
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.