A Simple hello world for the MMA8652

Dependencies:   MMA8652 mbed

Files at this revision

API Documentation at this revision

Comitter:
JimCarver
Date:
Sat Apr 19 20:30:47 2014 +0000
Commit message:
A Simple hello world for the MMA8652

Changed in this revision

MMA8652.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 230349f0612a MMA8652.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MMA8652.lib	Sat Apr 19 20:30:47 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JimCarver/code/MMA8652/#ff30cc4759b4
diff -r 000000000000 -r 230349f0612a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Apr 19 20:30:47 2014 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "MMA8652.h"
+
+MMA8652 acc( A4, A5);
+Serial pc(USBTX, USBRX);
+
+
+int main() {
+float acc_data[3];
+
+printf("\r\n\nMMA8652 Who Am I= %X\r\n", acc.getWhoAmI());
+    while (true) {
+        acc.ReadXYZ(acc_data);
+        printf("MMA8652 ACC: X=%1.4f Y=%1.4f Z=%1.4f\r\n\n", acc_data[0], acc_data[1], acc_data[2]);
+        wait(1.0);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 230349f0612a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Apr 19 20:30:47 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file