A data logger for the FRDM-K64F taking readings from the FXOS8700CQ accelerometer/magnometer at 200Hz.
Dependencies: FXOS8700CQ SDFileSystem mbed
Fork of Hello_FXOS8700Q by
Revision 4:4b494ca218ff, committed 2014-04-23
- Comitter:
- JimCarver
- Date:
- Wed Apr 23 17:12:21 2014 +0000
- Parent:
- 3:912ef9b2cc6a
- Child:
- 5:061ab9f2c002
- Commit message:
- experiment
Changed in this revision
--- a/FXOS8700Q.lib Wed Apr 23 16:43:23 2014 +0000 +++ b/FXOS8700Q.lib Wed Apr 23 17:12:21 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/JimCarver/code/FXOS8700Q/#be6abf9f2d59 +http://mbed.org/users/JimCarver/code/FXOS8700Q/#c4176a12f7d5
--- a/MotionSensor.lib Wed Apr 23 16:43:23 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/teams/components/code/MotionSensor/#dbc8909af0eb
--- a/main.cpp Wed Apr 23 16:43:23 2014 +0000 +++ b/main.cpp Wed Apr 23 17:12:21 2014 +0000 @@ -1,10 +1,16 @@ #include "mbed.h" #include "FXOS8700Q.h" + //FXOS8700Q combo( A4, A5, FXOS8700CQ_SLAVE_ADDR0); // Proper Ports and I2C address for FReescale Multi Axis shield -FXOS8700Q combo( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); // Proper Ports and I2C Address for K64F Freedom board +FXOS8700Q_acc acc( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); // Proper Ports and I2C Address for K64F Freedom board +FXOS8700Q_mag mag( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); // Proper Ports and I2C Address for K64F Freedom board + Serial pc(USBTX, USBRX); +MotionSensorDataUnits mag; +MotionSensorDataUnits acc; + /* int main(void) { MotionSensor sensor; @@ -46,8 +52,8 @@ printf("\r\n\nFXOS8700Q Who Am I= %X\r\n", combo.getWhoAmI()); while (true) { - combo.getAccAllAxis(acc_data); - combo.getMagAllAxis(mag_data); + combo.getAxis(acc); + combo.getAxis(mag); printf("FXOS8700Q ACC: X=%1.4f Y=%1.4f Z=%1.4f ", acc_data[0], acc_data[1], acc_data[2]); printf(" MAG: X=%4.1f Y=%4.1f Z=%4.1f\r\n\n", mag_data[0], mag_data[1], mag_data[2]); wait(1.0);