Collects 30 samples from ADXL345 (3 axis Accelerometer, Sprakfun SEN-09836 breakout board) based on interrupt and presents the data.
Diff: main.cpp
- Revision:
- 1:7dbdddce7156
- Parent:
- 0:a50c8bfe4605
- Child:
- 2:4ed2dd2347f3
--- a/main.cpp Mon Jul 25 17:23:42 2011 +0000 +++ b/main.cpp Mon Jul 25 19:13:06 2011 +0000 @@ -53,7 +53,6 @@ int main() { int i; - char is; float xx, yy, zz; pc.baud(9600); @@ -65,12 +64,12 @@ ////////////////// get the data ////////////////////// interrupt_counter= -1; timer.start(); - pc.printf("\n\n\rBussy collecting data "); + pc.printf("\n\rBussy collecting data\n\r "); while (interrupt_counter < (NOSAMPLES-1)) - pc.printf(".%0x.", is); - pc.printf("\r\n"); + pc.printf("."); ///////////////// present the data //////////////////// + pc.printf("\r"); for (i=0; i <NOSAMPLES; i++) { xx= data[i].x *0.00312; // 13-bit, sign extended values, 31.2 mg/LSB yy= data[i].y *0.00312;