Aaron Berk
/
SCA3000_HelloWorld
SCA3000 triple axis digital interface accelerometer example.
Revision 0:353334207b2c, committed 2011-05-29
- Comitter:
- aberk
- Date:
- Sun May 29 14:22:44 2011 +0000
- Commit message:
- Version 1.0
Changed in this revision
diff -r 000000000000 -r 353334207b2c SCA3000.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SCA3000.lib Sun May 29 14:22:44 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/aberk/code/SCA3000/#f5f2e79304fb
diff -r 000000000000 -r 353334207b2c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 29 14:22:44 2011 +0000 @@ -0,0 +1,27 @@ +#include "SCA3000.h" + +Serial pc(USBTX, USBRX); +SCA3000 accelerometer(p5, p6, p7, p8, p9); + +int main() { + + pc.printf("Starting SCA3000 test...\n"); + + int revision = accelerometer.getRevId(); + + pc.printf("Device revision number is: %i.%i\n", revision & 0xF0, revision & 0x0F); + + + while(1){ + + //Arbitrary wait for printf clarity. + wait(0.1); + + //Print out the acceleration measured on each axis in milli-gs. + pc.printf("x:%f y:%f z:%f\n", accelerometer.getAcceleration(SCA3000_X_AXIS), + accelerometer.getAcceleration(SCA3000_Y_AXIS), + accelerometer.getAcceleration(SCA3000_Z_AXIS)); + + } + +}
diff -r 000000000000 -r 353334207b2c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 29 14:22:44 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912