KX022 accelerometer library test program

Dependencies:   KX022 mbed

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Wed Dec 30 16:16:41 2015 +0000
Child:
1:a531b03fca97
Commit message:
Initial commit

Changed in this revision

KX022.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KX022.lib	Wed Dec 30 16:16:41 2015 +0000
@@ -0,0 +1,1 @@
+KX022#e642dd732c4b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 30 16:16:41 2015 +0000
@@ -0,0 +1,15 @@
+
+#include "mbed.h"
+#include "KX022.h"
+
+Serial pc(USBTX, USBRX);
+KX022 acc(I2C_SDA, I2C_SCL);
+
+int main() {
+    pc.printf("\nKX022 Accelerometer library test program.\n");
+    
+    while(1) {
+        wait(0.5);
+        pc.printf("x=%7.4f, y=%7.4f, z=%7.4f\n", acc.getAccX(), acc.getAccY(), acc.getAccZ());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Dec 30 16:16:41 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file