SparkFun_ADXL345_Arduino_Library icon indicating copy to clipboard operation
SparkFun_ADXL345_Arduino_Library copied to clipboard

Library has the "ALT" I2C device address hard-coded. SDO needs to be 0v

Open greiginsydney opened this issue 1 year ago • 0 comments

This library has the ADXL345's "ALT" I2C device address hard-coded.

From the ADXL345's data sheet (p17):

With the ALT ADDRESS pin high, the 7-bit I2C address for the device is 0x1D, followed by the R/W bit.
This translates to 0x3A for a write and 0x3B for a read.
An alternate I2C address of 0x53 (followed by the R/W bit) can be chosen by grounding the SDO/ALT ADDRESS pin (Pin 12).

and in src/SparkFun_ADXL345.cpp is:

#define ADXL345_DEVICE (0x53)    // Device Address for ADXL345

So if you're using the library as is and trying to talk I2C to it, make sure you ground the SDO pin.


- Greig.

greiginsydney avatar Mar 24 '25 05:03 greiginsydney