mirror of
https://github.com/adafruit/Adafruit_BMP085_Unified.git
synced 2025-08-04 03:14:26 +02:00
Added bool return type to getEvent
This commit is contained in:
@@ -463,7 +463,7 @@ void Adafruit_BMP085_Unified::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_Unified::getEvent(sensors_event_t *event)
|
bool Adafruit_BMP085_Unified::getEvent(sensors_event_t *event)
|
||||||
{
|
{
|
||||||
float pressure_kPa;
|
float pressure_kPa;
|
||||||
|
|
||||||
@@ -476,4 +476,6 @@ void Adafruit_BMP085_Unified::getEvent(sensors_event_t *event)
|
|||||||
event->timestamp = 0;
|
event->timestamp = 0;
|
||||||
getPressure(&pressure_kPa);
|
getPressure(&pressure_kPa);
|
||||||
event->pressure = pressure_kPa / 100.0F;
|
event->pressure = pressure_kPa / 100.0F;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -111,7 +111,7 @@ class Adafruit_BMP085_Unified : public Adafruit_Sensor
|
|||||||
// calculation is used which does not need temperature.
|
// calculation is used which does not need temperature.
|
||||||
float pressureToAltitude(float seaLevel, float atmospheric, float temp);
|
float pressureToAltitude(float seaLevel, float atmospheric, float temp);
|
||||||
float seaLevelForAltitude(float altitude, float atmospheric, float temp);
|
float seaLevelForAltitude(float altitude, float atmospheric, float temp);
|
||||||
void getEvent(sensors_event_t*);
|
bool getEvent(sensors_event_t*);
|
||||||
void getSensor(sensor_t*);
|
void getSensor(sensor_t*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user