This is an export for Dan

Dependencies:   ADXL345 mbed

Fork of ADXL345_HelloWorld by Aaron Berk

Files at this revision

API Documentation at this revision

Comitter:
atravieso
Date:
Thu Apr 14 18:51:37 2016 +0000
Parent:
0:9e92575dece6
Commit message:
Export for Dan

Changed in this revision

ADXL345.lib Show annotated file Show diff for this revision Revisions of this file
ADXL345_lib.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADXL345.lib	Thu Apr 14 18:51:37 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/aberk/code/ADXL345/#bd8f0f20f433
--- a/ADXL345_lib.lib	Tue Aug 03 08:31:00 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/aberk/programs/ADXL345_lib/latest
\ No newline at end of file
--- a/main.cpp	Tue Aug 03 08:31:00 2010 +0000
+++ b/main.cpp	Thu Apr 14 18:51:37 2016 +0000
@@ -16,8 +16,8 @@
     //Full resolution, +/-16g, 4mg/LSB.
     accelerometer.setDataFormatControl(0x0B);
     
-    //3.2kHz data rate.
-    accelerometer.setDataRate(ADXL345_3200HZ);
+    //3.2kHz data rate. Changed from 3.2k to 25Hz
+    accelerometer.setDataRate(ADXL345_25HZ);
 
     //Measurement mode.
     accelerometer.setPowerControl(0x08);
@@ -29,7 +29,7 @@
         accelerometer.getOutput(readings);
         
         //13-bit, sign extended values.
-        pc.printf("%i, %i, %i\n", (int16_t)readings[0], (int16_t)readings[1], (int16_t)readings[2]);
+        pc.printf("X:%i, Y:%i, Z:%i\r\n", (int16_t)readings[0], (int16_t)readings[1], (int16_t)readings[2]);
 
     }