AE-KXSD9 test

Dependencies:   AE_KXSD9 mbed

Files at this revision

API Documentation at this revision

Comitter:
Naoto_111
Date:
Fri May 16 14:24:49 2014 +0000
Commit message:
AE-KXSD9 test

Changed in this revision

AE_KXSD9.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/AE_KXSD9.lib	Fri May 16 14:24:49 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Naoto_111/code/AE_KXSD9/#4dc1a0ac0cf1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 16 14:24:49 2014 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "AE_KXSD9.h"
+#define ADDR_W 0x30
+#define ADDR_R 0x31
+
+Serial pc(USBTX, USBRX); // tx, rx
+AE_KXSD9 i2c(p28, p27, ADDR_W, ADDR_R); //sda, scl, addr_w, addr_r
+
+int main() {
+        double x,y,z;
+        i2c.init();
+    while(1){
+        i2c.read_xyz(&x,&y,&z);
+        pc.printf("\033[2J\033[0;0H");//clear console
+        pc.printf("x:%lf\r\ny:%lf\r\nz:%lf\r\n",x,y,z);
+        wait(1.0);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 16 14:24:49 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776
\ No newline at end of file