Documentation ¶
Overview ¶
Package bmp180 provides a driver for the BMP180 digital pressure sensor by Bosch.
Datasheet: https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
Index ¶
Constants ¶
const ( AC1_MSB = 0xAA // Calibration coefficients start at 0xAA ends at 0xBF CMD_TEMP = 0x2E CMD_PRESSURE = 0x34 REG_CTRL = 0xF4 REG_TEMP_MSB = 0xF6 REG_PRESSURE_MSB = 0xF6 WHO_AM_I = 0xD0 CHIP_ID = 0x55 )
Registers. Names, addresses and comments copied from the datasheet.
const Address = 0x77
The I2C address which this device listens to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint16 // contains filtered or unexported fields }
Device wraps an I2C connection to a BMP180 device.
func New ¶
New creates a new BMP180 connection. The I2C bus must already be configured.
This function only creates the Device object, it does not initialize the device. You must call Configure() first in order to use the device itself.
func (*Device) Configure ¶
func (d *Device) Configure()
Configure sets up the device for communication and read the calibration coefficients.
func (*Device) Connected ¶
Connected returns whether a BMP180 has been found. It does a "who am I" request and checks the response.
func (*Device) ReadPressure ¶
ReadPressure returns the pressure in milli pascals (mPa).
func (*Device) ReadTemperature ¶
ReadTemperature returns the temperature in celsius milli degrees (ºC/1000).
type OversamplingMode ¶
type OversamplingMode uint
OversamplingMode is the oversampling ratio of the pressure measurement.
const ( // ULTRALOWPOWER is the lowest oversampling mode of the pressure measurement. ULTRALOWPOWER OversamplingMode = iota // BSTANDARD is the standard oversampling mode of the pressure measurement. STANDARD // HIGHRESOLUTION is a high oversampling mode of the pressure measurement. HIGHRESOLUTION // ULTRAHIGHRESOLUTION is the highest oversampling mode of the pressure measurement. ULTRAHIGHRESOLUTION )