Skip to content

tvlad1234/pico-bmp085Driv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pico-bmp085Driv

BMP085/BMP180 library for pico-sdk
Based on Adafruit-BMP085-Library
Examples can be found here

Usage

Add the pico-bmp085Driv subdirectory to the CMakeLists.txt of your project and include the library in target_link_libraries.

Initializing the sensor

Before reading the sensor, it must be initialized with BMP085_init.
BMP085_init the sensor mode as a parameter
Example: BMP085_init(BMP085_STANDARD);
Other usable modes are BMP085_ULTRALOWPOWER, BMP085_HIGHRES, BMP085_ULTRAHIGHRES.

By default, the library uses pins 4 (SDA) and 5 (SCL). BMP085_setI2C(i2c_inst_t *i, uint16_t sda, uint16_t scl, uint8_t addr); can be used to select the I2C peripheral, pins and sensor adress.

Reading the sensor

BMP085_readTemperature() returns the temperature in °C as float.
BMP085_readPressure() returns the atmospheric pressure in Pascals (Pa) as uint32_t.