Driver for ADXL345

Dependents:   m3Dpi

Fork of ADXL345_I2C by Ian Molesworth

Files at this revision

API Documentation at this revision

Comitter:
sillevl
Date:
Sat Dec 19 10:40:48 2015 +0000
Parent:
2:f2d04afa9603
Commit message:
add constructor that accepts I2C object

Changed in this revision

ADXL345_I2C.cpp Show annotated file Show diff for this revision Revisions of this file
ADXL345_I2C.h Show annotated file Show diff for this revision Revisions of this file
diff -r f2d04afa9603 -r a453a5e561c2 ADXL345_I2C.cpp
--- a/ADXL345_I2C.cpp	Sat Dec 19 09:17:19 2015 +0000
+++ b/ADXL345_I2C.cpp	Sat Dec 19 10:40:48 2015 +0000
@@ -47,6 +47,11 @@
 
 }
 
+ADXL345_I2C::ADXL345_I2C(I2C &i2c) : i2c_(i2c)
+{
+    
+}
+
 char ADXL345_I2C::getDevId(void) {
 
     return oneByteRead(ADXL345_DEVID_REG);
diff -r f2d04afa9603 -r a453a5e561c2 ADXL345_I2C.h
--- a/ADXL345_I2C.h	Sat Dec 19 09:17:19 2015 +0000
+++ b/ADXL345_I2C.h	Sat Dec 19 10:40:48 2015 +0000
@@ -115,6 +115,8 @@
      * @param cs mbed pin to use for not chip select line of I2C interface.
      */
     ADXL345_I2C(PinName sda, PinName scl);
+    
+    ADXL345_I2C(I2C &i2c);
 
     /**
      * Read the device ID register on the device.