Skip to content
Alexander Hiam edited this page Apr 17, 2015 · 2 revisions

The BMP183 library allows you to connect to a BMP183 pressure and temperature sensor over SPI.

Adafruit sells a nice breakout for the BMP183: https://www.adafruit.com/products/1900

##Examples

##API

####BMP183(spi_bus) Creates an instance of the BMP183 class using the given SPI bus (SPI0 or SPI1).
An AssertionError will be thrown if no BMP183 is found on the SPI bus.
The SPI bus will be configured in clock mode 0 and with a maximum clock rate of 3MHz.

#####BMP183.getPressure(oversampling=OVERSAMPLE_0) Returns the current pressure in Pascals. The optional parameter 'oversampling' can be given as one of BMP183.OVERSAMPLE_1, BMP183.OVERSAMPLE_2, or BMP183.OVERSAMPLE_3 for averaging of 2, 4 or 8 samples respectively.

#####BMP183.getPressurePSI(oversampling=OVERSAMPLE_0) Returns the current pressure in PSI. The optional parameter 'oversampling' can be given as one of BMP183.OVERSAMPLE_1, BMP183.OVERSAMPLE_2, or BMP183.OVERSAMPLE_3 for averaging of 2, 4 or 8 samples respectively.

#####BMP183.getTemp() Returns current temperature in Celsius.

#####BMP183.getTempF() Returns current temperature in Fahrenheit.