Forked from Uwe Gartmann's ADXL345 library, customized as part of the 9DOF stick from Sparkfun.com

Fork of ADXL345 by Uwe Gartmann

ADXL345 is triple axis, digital interface, accelerometer.

This library is forked from Uwe Gartmann and Peter Swanson's work.

This library is for specific application using 9DoF-Stick.

Datasheet:

http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf

ADXL345は3軸のデジタルインターフェースを備えた加速度センサです。

このライブラリは 9DoF-Stick を使用した特定の企画のために保守しています。

mbed IDEが日本語をサポートするまでは英語でコメントを書いていきますが、サポートした後もきっと英語で書いていくでしょう。

Revision:
5:122a504fcfa3
Parent:
4:8046894b947e
--- a/ADXL345.h	Mon Sep 17 10:39:19 2012 +0000
+++ b/ADXL345.h	Sat Sep 29 14:15:24 2012 +0000
@@ -134,6 +134,21 @@
      * @param sck mbed pin to use for SCL line of I2C interface.
      */
     ADXL345(PinName sda, PinName scl);
+    
+
+    /**
+     * Constructor that accepts external i2c interface object.
+     *
+     * @param i2c The I2C interface object to use.
+     */
+    ADXL345(I2C &i2c) : i2c_(i2c), myI2c(NULL){}
+    
+    /**
+     * Destructor that frees self-allocated I2C object.
+     */
+    ~ADXL345();
+    
+    void init();
 
     /**
      * Get the output of all three axes.
@@ -530,7 +545,9 @@
    
 private:
 
-    I2C i2c_;
+    I2C &i2c_;
+    
+    I2C *myI2c;
     
 
     /**