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.
Revision 0:a2ca34fbe933, committed 2017-01-31
- Comitter:
- eencae
- Date:
- Tue Jan 31 19:05:19 2017 +0000
- Child:
- 1:62b9d4243e97
- Commit message:
- Example code for using FXOS8700CQ library.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FXOS8700CQ.lib Tue Jan 31 19:05:19 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/eencae/code/FXOS8700CQ/#f66eda6a492a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jan 31 19:05:19 2017 +0000
@@ -0,0 +1,33 @@
+/* FXOS8700CQ Library
+
+Sample code from ELEC2645 - demonstrates how to create a library
+for the K64F on-board accelerometer and magnetometer
+
+(c) Craig A. Evans, University of Leeds, Jan 2017
+
+*/
+
+#include "mbed.h"
+#include "FXOS8700CQ.h"
+
+// create object and specifiy pins
+FXOS8700CQ device(I2C_SDA,I2C_SCL);
+
+int main()
+{
+ // call initialisation method
+ device.init();
+
+ while (1) {
+
+ // poll the sensor and get the values, storing in a struct
+ Data values = device.get_values();
+
+ // print each struct member over serial
+ printf("ax = %f ay = %f az = %f | mx = %f my = %f mz = %f\n"
+ ,values.ax, values.ay, values.az
+ ,values.mx, values.my, values.mz);
+
+ wait(0.5);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jan 31 19:05:19 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5 \ No newline at end of file
