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.
Test:
Click "File->Examples->Adafruit_ADXL345->sensortest" to load the example sketch from the library.
Then click on the compile/upload button to compile and upload the sketch to the Arduino. You should see output
similar to below. Watch the values change as you move the board around.
Calibrate:
The ADXL chips are calibrated at the factory to a level of precision sufficient for most purposes. For critical applications
where a higher degree of accuracy is required, you may wish to re-calibrate the sensor yourself.
Calibration does not change the sensor outputs. But it tells you what the sensor output is for a known stable reference
force in both directions on each axis. Knowing that, you can calculate the corrected output from a sensor reading.