A simple hello world for the FXAS21000 gyro from Freescale

Dependencies:   FXAS21000 mbed

Files at this revision

API Documentation at this revision

Comitter:
JimCarver
Date:
Sat Apr 19 00:24:36 2014 +0000
Commit message:
Hello World for the FXAS21000

Changed in this revision

FXAS21000.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r af0125b51903 FXAS21000.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FXAS21000.lib	Sat Apr 19 00:24:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JimCarver/code/FXAS21000/#88a036a417bf
diff -r 000000000000 -r af0125b51903 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Apr 19 00:24:36 2014 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "FXAS21000.h"
+
+FXAS21000 gyro( A4, A5);
+Serial pc(USBTX, USBRX);
+
+
+int main() {
+float gyro_data[3];
+
+printf("\r\n\nFXAS21000 Who Am I= %X\r\n", gyro.getWhoAmI());
+    while (true) {
+        gyro.ReadXYZ(gyro_data);
+        printf("FXAS21000      X=%4.2f Y=%4.2f Z=%4.1f\r\n", gyro_data[0], gyro_data[1], gyro_data[2]);
+        wait(1.0);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r af0125b51903 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Apr 19 00:24:36 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file