Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Hello_FXOS8700Q by
Revision 5:061ab9f2c002, committed 2014-04-24
- Comitter:
- JimCarver
- Date:
- Thu Apr 24 16:31:17 2014 +0000
- Parent:
- 4:4b494ca218ff
- Child:
- 6:02bfeec82bc1
- Commit message:
- Temporary Version
Changed in this revision
| FXOS8700Q.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/FXOS8700Q.lib Wed Apr 23 17:12:21 2014 +0000 +++ b/FXOS8700Q.lib Thu Apr 24 16:31:17 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/JimCarver/code/FXOS8700Q/#c4176a12f7d5 +http://mbed.org/users/JimCarver/code/FXOS8700Q/#cdc362f08339
--- a/main.cpp Wed Apr 23 17:12:21 2014 +0000
+++ b/main.cpp Thu Apr 24 16:31:17 2014 +0000
@@ -8,8 +8,11 @@
Serial pc(USBTX, USBRX);
-MotionSensorDataUnits mag;
-MotionSensorDataUnits acc;
+MotionSensorDataUnits mag_data;
+MotionSensorDataUnits acc_data;
+
+MotionSensorDataCounts mag_raw;
+MotionSensorDataCounts acc_raw;
/*
int main(void) {
@@ -22,13 +25,13 @@
if(sensor.dataReady())
{
SensorDataUnits formatted_data;
- sensor.getAxis(formatted_data);
+ sensor.getAxis(&formatted_data);
printf(asdfadsf);
}
if(sensor.dataReady())
{
SensorDataCounts raw_data;
- sensor.getAxis(formatted_data);
+ sensor.getAxis(&raw_data);
printf(asdfasdf);
}
if(sensor.dataReady())
@@ -48,14 +51,14 @@
int main() {
-float acc_data[3], mag_data[3];
-printf("\r\n\nFXOS8700Q Who Am I= %X\r\n", combo.getWhoAmI());
+acc.enable();
+printf("\r\n\nFXOS8700Q Who Am I= %X\r\n", acc.whoAmI());
while (true) {
- 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]);
+ acc.getAxis(acc_data);
+ mag.getAxis(mag_data);
+ printf("FXOS8700Q ACC: X=%1.4f Y=%1.4f Z=%1.4f ", acc_data.x, acc_data.y, acc_data.z);
+ printf(" MAG: X=%4.1f Y=%4.1f Z=%4.1f\r\n\n", mag_data.x, mag_data.y, mag_data.z);
wait(1.0);
}
}
\ No newline at end of file
