Amanda Travieso
/
Accelerometer
This is an export for Dan
Fork of ADXL345_HelloWorld by
Revision 1:ba867c823c0b, committed 2016-04-14
- Comitter:
- atravieso
- Date:
- Thu Apr 14 18:51:37 2016 +0000
- Parent:
- 0:9e92575dece6
- Commit message:
- Export for Dan
Changed in this revision
diff -r 9e92575dece6 -r ba867c823c0b ADXL345.lib --- /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
diff -r 9e92575dece6 -r ba867c823c0b ADXL345_lib.lib --- 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
diff -r 9e92575dece6 -r ba867c823c0b main.cpp --- 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]); }