Breakout boards for these modules feature on-board 3.3v voltage regulation and level shifting which makes them simple to interface with 5v microcontrollers such as the Arduino. The ADXL345 features 4 sensitivity ranges from +/- 2G to +/- 16G. And it supports output data rates ranging from 10Hz to 3200Hz.
I2C Wiring: The ADXL345 Breakout has an I2C address of 0x53. It can share the I2C bus with other I2C devices as long as each device has a unique address. Only 4 connections are required for I2C communication: GND->GND VIN->+5v...
Programming and Calibration Install the Library: Download the ADXL345 library (https://adafru.it/aZn) and install it. You will also need the Adafruit Sensor Library (https://adafru.it/aZm) if you do not already have it installed. This guide (https://adafru.it/aYM) will help you with the install process.
Page 12
Serial.begin(9600); Serial.println("ADXL345 Accelerometer Calibration"); Serial.println(""); /* Initialise the sensor */ if(!accel.begin()) /* There was a problem detecting the ADXL345 ... check your connections */ Serial.println("Ooops, no ADXL345 detected ... Check your wiring!"); while(1); void loop(void) Serial.println("Type key when ready..."); while (!Serial.available()){}...
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.
Need help?
Do you have a question about the ADXL345 and is the answer not in the manual?
Questions and answers