mirror of
https://github.com/adafruit/Adafruit_BMP085_Unified.git
synced 2025-08-03 02:44:27 +02:00
Updated to use _Unified class names
This commit is contained in:
@@ -210,10 +210,10 @@ static void readRawPressure(int32_t *pressure)
|
|||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
@brief Instantiates a new Adafruit_BMP085 class
|
@brief Instantiates a new Adafruit_BMP085_Unified class
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
Adafruit_BMP085::Adafruit_BMP085(int32_t sensorID) {
|
Adafruit_BMP085_Unified::Adafruit_BMP085_Unified(int32_t sensorID) {
|
||||||
_sensorID = sensorID;
|
_sensorID = sensorID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ Adafruit_BMP085::Adafruit_BMP085(int32_t sensorID) {
|
|||||||
@brief Setups the HW
|
@brief Setups the HW
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
bool Adafruit_BMP085::begin(bmp085_mode_t mode)
|
bool Adafruit_BMP085_Unified::begin(bmp085_mode_t mode)
|
||||||
{
|
{
|
||||||
// Enable I2C
|
// Enable I2C
|
||||||
Wire.begin();
|
Wire.begin();
|
||||||
@@ -259,7 +259,7 @@ bool Adafruit_BMP085::begin(bmp085_mode_t mode)
|
|||||||
@brief Gets the compensated pressure level in kPa
|
@brief Gets the compensated pressure level in kPa
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_BMP085::getPressure(float *pressure)
|
void Adafruit_BMP085_Unified::getPressure(float *pressure)
|
||||||
{
|
{
|
||||||
int32_t ut = 0, up = 0, compp = 0;
|
int32_t ut = 0, up = 0, compp = 0;
|
||||||
int32_t x1, x2, b5, b6, x3, b3, p;
|
int32_t x1, x2, b5, b6, x3, b3, p;
|
||||||
@@ -309,7 +309,7 @@ void Adafruit_BMP085::getPressure(float *pressure)
|
|||||||
@brief Reads the temperatures in degrees Celsius
|
@brief Reads the temperatures in degrees Celsius
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_BMP085::getTemperature(float *temp)
|
void Adafruit_BMP085_Unified::getTemperature(float *temp)
|
||||||
{
|
{
|
||||||
int32_t UT, X1, X2, B5; // following ds convention
|
int32_t UT, X1, X2, B5; // following ds convention
|
||||||
float t;
|
float t;
|
||||||
@@ -345,7 +345,7 @@ void Adafruit_BMP085::getTemperature(float *temp)
|
|||||||
@param temp Temperature in degrees Celsius
|
@param temp Temperature in degrees Celsius
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
float Adafruit_BMP085::pressureToAltitude(float seaLevel, float atmospheric, float temp)
|
float Adafruit_BMP085_Unified::pressureToAltitude(float seaLevel, float atmospheric, float temp)
|
||||||
{
|
{
|
||||||
/* Hyposometric formula: */
|
/* Hyposometric formula: */
|
||||||
/* */
|
/* */
|
||||||
@@ -367,7 +367,7 @@ float Adafruit_BMP085::pressureToAltitude(float seaLevel, float atmospheric, flo
|
|||||||
@brief Provides the sensor_t data for this sensor
|
@brief Provides the sensor_t data for this sensor
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_BMP085::getSensor(sensor_t *sensor)
|
void Adafruit_BMP085_Unified::getSensor(sensor_t *sensor)
|
||||||
{
|
{
|
||||||
/* Clear the sensor_t object */
|
/* Clear the sensor_t object */
|
||||||
memset(sensor, 0, sizeof(sensor_t));
|
memset(sensor, 0, sizeof(sensor_t));
|
||||||
@@ -389,7 +389,7 @@ void Adafruit_BMP085::getSensor(sensor_t *sensor)
|
|||||||
@brief Reads the sensor and returns the data as a sensors_event_t
|
@brief Reads the sensor and returns the data as a sensors_event_t
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_BMP085::getEvent(sensors_event_t *event)
|
void Adafruit_BMP085_Unified::getEvent(sensors_event_t *event)
|
||||||
{
|
{
|
||||||
float pressure_kPa;
|
float pressure_kPa;
|
||||||
|
|
||||||
|
@@ -88,10 +88,10 @@
|
|||||||
} bmp085_calib_data;
|
} bmp085_calib_data;
|
||||||
/*=========================================================================*/
|
/*=========================================================================*/
|
||||||
|
|
||||||
class Adafruit_BMP085 : public Adafruit_Sensor
|
class Adafruit_BMP085_Unified : public Adafruit_Sensor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Adafruit_BMP085(int32_t sensorID = -1);
|
Adafruit_BMP085_Unified(int32_t sensorID = -1);
|
||||||
|
|
||||||
bool begin(bmp085_mode_t mode = BMP085_MODE_ULTRAHIGHRES);
|
bool begin(bmp085_mode_t mode = BMP085_MODE_ULTRAHIGHRES);
|
||||||
void getTemperature(float *temp);
|
void getTemperature(float *temp);
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
2013/FEB/13 - First version (KTOWN)
|
2013/FEB/13 - First version (KTOWN)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Adafruit_BMP085 bmp = Adafruit_BMP085(10085);
|
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user