diff --git a/Adafruit_ADXL345_U.cpp b/Adafruit_ADXL345_U.cpp index 28a4c67..74f7a7f 100644 --- a/Adafruit_ADXL345_U.cpp +++ b/Adafruit_ADXL345_U.cpp @@ -295,7 +295,7 @@ dataRate_t Adafruit_ADXL345_Unified::getDataRate(void) @brief Gets the most recent sensor event */ /**************************************************************************/ -void Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { +bool Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { /* Clear the event */ memset(event, 0, sizeof(sensors_event_t)); @@ -306,6 +306,8 @@ void Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { event->acceleration.x = getX() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; event->acceleration.y = getY() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; event->acceleration.z = getZ() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; + + return true; } /**************************************************************************/ diff --git a/Adafruit_ADXL345_U.h b/Adafruit_ADXL345_U.h index 58b0054..8f7da79 100644 --- a/Adafruit_ADXL345_U.h +++ b/Adafruit_ADXL345_U.h @@ -113,7 +113,7 @@ class Adafruit_ADXL345_Unified : public Adafruit_Sensor { range_t getRange(void); void setDataRate(dataRate_t dataRate); dataRate_t getDataRate(void); - void getEvent(sensors_event_t*); + bool getEvent(sensors_event_t*); void getSensor(sensor_t*); uint8_t getDeviceID(void);