ADXL345 3-axis Acceleration Sensor sample

Dependencies:   ADXL345_I2C mbed

Fork of ADXL345 by James Allen

About ADXL345

ADXL345 is a 3-axis acceleration sensor and can be controlled by using the I2C.

About sample program

This program outputs the acceleration information of 3-axis to the terminal.
The 3-axis is as follows:
/media/uploads/1050186/adxl345_axis_1.png
In the graph, the acceleration information of 3-axis showes.
/media/uploads/1050186/tilt.png /media/uploads/1050186/adxl345_output_to_graph_1.png

About wiring

SensorGR-PEACH
VDD3.3V
GNDGND
SCLD15
SDAD14
Revision:
1:c835cfa8b41c
Parent:
0:75c7bfd01ea0
--- a/main.cpp	Fri Mar 11 15:54:40 2011 +0000
+++ b/main.cpp	Thu Apr 28 11:23:58 2016 +0000
@@ -1,8 +1,7 @@
 #include "mbed.h"
 #include "ADXL345_I2C.h"
  
-//ADXL345 accelerometer(p5, p6, p7, p8);
-ADXL345_I2C accelerometer(p9, p10);
+ADXL345_I2C accelerometer(I2C_SDA, I2C_SCL);
 Serial pc(USBTX, USBRX);
  
 int main()