EasyManuals Logo

Adafruit Industries ADXL345 User Manual

Default Icon
17 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #14 background imageLoading...
Page #14 background image
Library Reference
Constructor:
Adafruit_ADXL345(int32_t sensorID = -1)
Constructs an instance of the ADXL345 device driver object. 'sensorID' is a device identifier. It will be returned in the
sensor_event in each call to getEvent(). The sensorID has no effect on the operation of the driver or device, but is
useful in managing sensor events in systems with multiple sensors.
Initialization()
bool begin(void)
The begin() function initializes communication with the device. The return value is 'true' if it succeeds in connecting to
the ADXL345.
Sensor Details:
void getSensor(sensor_t*);
The getSensor() function returns basic information about the sensor. For details about the sensor_t structure, refer to
the ReadMe file (https://adafru.it/aZm) for the Adafruit Sensor Library.
Getting and Setting the operating range:
void setRange(range_t range)
The setRange() function sets the operating range for the sensor. Higher values will have a wider measurement range.
Lower values will have more sensitivity.
Valid range constants are:
ADXL345_RANGE_16_G
ADXL345_RANGE_8_G
ADXL345_RANGE_4_G
ADXL345_RANGE_2_G (default value)
range_t getRange(void);
The getRange() function returns the current operating range as set by setRange()
Getting and Setting the Data Rate:
void setDataRate(dataRate_t dataRate);
The setDataRate() function sets the rate at which the sensor output is updated. Rates above 100 Hz will exhibit
increased noise. Rates below 6.25 Hz will be more sensitive to temperature variations. See the data
sheet (https://adafru.it/c5e) for details.
Valid data rate constants are:
ADXL345_DATARATE_3200_HZ
© Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 14 of 17

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Adafruit Industries ADXL345 and is the answer not in the manual?

Adafruit Industries ADXL345 Specifications

General IconGeneral
BrandAdafruit Industries
ModelADXL345
CategoryControl Unit
LanguageEnglish