We have arduino drivers for the ADXL345
, but we currently have none for the Pi. However, we do have a growing set of Pi drivers here
. Have a look at a few and see if you find them suitable for use as templates to write your own. The arduino drivers can serve as logic references and sanity checks.