From 123857de69d24320e532ee8513c54b0f08bb2551 Mon Sep 17 00:00:00 2001 From: KTOWN Date: Mon, 25 Nov 2013 23:31:25 +0100 Subject: [PATCH] Updated to use '_Unified' class names --- Adafruit_ADXL345.cpp | 16 ++++++++-------- Adafruit_ADXL345.h | 4 ++-- examples/sensortest/sensortest.pde | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Adafruit_ADXL345.cpp b/Adafruit_ADXL345.cpp index 4b4c4d1..2116725 100644 --- a/Adafruit_ADXL345.cpp +++ b/Adafruit_ADXL345.cpp @@ -137,7 +137,7 @@ static int16_t getZ(void) { @brief Instantiates a new ADXL345 class */ /**************************************************************************/ -Adafruit_ADXL345::Adafruit_ADXL345(int32_t sensorID) { +Adafruit_ADXL345_Unified::Adafruit_ADXL345_Unified(int32_t sensorID) { _sensorID = sensorID; _range = ADXL345_RANGE_2_G; } @@ -147,7 +147,7 @@ Adafruit_ADXL345::Adafruit_ADXL345(int32_t sensorID) { @brief Setups the HW (reads coefficients values, etc.) */ /**************************************************************************/ -bool Adafruit_ADXL345::begin() { +bool Adafruit_ADXL345_Unified::begin() { Wire.begin(); /* Check connection */ @@ -170,7 +170,7 @@ bool Adafruit_ADXL345::begin() { @brief Sets the g range for the accelerometer */ /**************************************************************************/ -void Adafruit_ADXL345::setRange(range_t range) +void Adafruit_ADXL345_Unified::setRange(range_t range) { /* Red the data format register to preserve bits */ uint8_t format = readRegister(ADXL345_REG_DATA_FORMAT); @@ -194,7 +194,7 @@ void Adafruit_ADXL345::setRange(range_t range) @brief Sets the g range for the accelerometer */ /**************************************************************************/ -range_t Adafruit_ADXL345::getRange(void) +range_t Adafruit_ADXL345_Unified::getRange(void) { /* Red the data format register to preserve bits */ return (range_t)(readRegister(ADXL345_REG_DATA_FORMAT) & 0x03); @@ -205,7 +205,7 @@ range_t Adafruit_ADXL345::getRange(void) @brief Sets the data rate for the ADXL345 (controls power consumption) */ /**************************************************************************/ -void Adafruit_ADXL345::setDataRate(dataRate_t dataRate) +void Adafruit_ADXL345_Unified::setDataRate(dataRate_t dataRate) { /* Note: The LOW_POWER bits are currently ignored and we always keep the device in 'normal' mode */ @@ -217,7 +217,7 @@ void Adafruit_ADXL345::setDataRate(dataRate_t dataRate) @brief Sets the data rate for the ADXL345 (controls power consumption) */ /**************************************************************************/ -dataRate_t Adafruit_ADXL345::getDataRate(void) +dataRate_t Adafruit_ADXL345_Unified::getDataRate(void) { return (dataRate_t)(readRegister(ADXL345_REG_BW_RATE) & 0x0F); } @@ -227,7 +227,7 @@ dataRate_t Adafruit_ADXL345::getDataRate(void) @brief Gets the most recent sensor event */ /**************************************************************************/ -void Adafruit_ADXL345::getEvent(sensors_event_t *event) { +void Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { /* Clear the event */ memset(event, 0, sizeof(sensors_event_t)); @@ -245,7 +245,7 @@ void Adafruit_ADXL345::getEvent(sensors_event_t *event) { @brief Gets the sensor_t data */ /**************************************************************************/ -void Adafruit_ADXL345::getSensor(sensor_t *sensor) { +void Adafruit_ADXL345_Unified::getSensor(sensor_t *sensor) { /* Clear the sensor_t object */ memset(sensor, 0, sizeof(sensor_t)); diff --git a/Adafruit_ADXL345.h b/Adafruit_ADXL345.h index 77d7ffc..e481752 100644 --- a/Adafruit_ADXL345.h +++ b/Adafruit_ADXL345.h @@ -103,9 +103,9 @@ typedef enum ADXL345_RANGE_2_G = 0b00 // +/- 2g (default value) } range_t; -class Adafruit_ADXL345 : public Adafruit_Sensor { +class Adafruit_ADXL345_Unified : public Adafruit_Sensor { public: - Adafruit_ADXL345(int32_t sensorID = -1); + Adafruit_ADXL345_Unified(int32_t sensorID = -1); bool begin(void); void setRange(range_t range); diff --git a/examples/sensortest/sensortest.pde b/examples/sensortest/sensortest.pde index e05316c..d41b41a 100644 --- a/examples/sensortest/sensortest.pde +++ b/examples/sensortest/sensortest.pde @@ -3,7 +3,7 @@ #include /* Assign a unique ID to this sensor at the same time */ -Adafruit_ADXL345 accel = Adafruit_ADXL345(12345); +Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); void displaySensorDetails(void) {