We have written code to double integrate the ADXL345.
You can find the code here for the cRIO (
http://proj.titanrobotics.net/hg/Frc...inc/TrcAccel.h)
But as Ryan said, it will cumulate error when you integrate it over time. Therefore, you must use caution when doing it. We reset the accumulator right before we start the PID control (which is what we use the accelerometer for). This will clear the cumulated error and start fresh. It works reasonably well for us. We also implemented Zero-G calibration to eliminate DC offset of the outputs.