An example program for Lazurite Graph

Dependencies:   BM1383GLV KX022 mbed

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Wed Mar 23 03:29:44 2016 +0000
Child:
1:55d8217fc776
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 Mar 23 03:29:44 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Rohm/code/KX022/#23bfc18affd9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 23 03:29:44 2016 +0000
@@ -0,0 +1,29 @@
+/*
+
+Test program to use Rohm sensors with Lazurite Graph application 
+http://www.lapis-semi.com/lazurite-jp/contents/LazuriteGraph/LazuriteGraph.html
+
+*/
+
+#include "mbed.h"
+#include "KX022.h"
+#include "BM1383GLV.h"
+
+Serial pc(USBTX, USBRX);
+KX022 acc(I2C_SDA, I2C_SCL);
+BM1383GLV sensor(I2C_SDA, I2C_SCL);
+
+int main() {
+    pc.baud(115200);
+    
+    while(1) {
+        pc.printf("STX,");
+        pc.printf("%.2f,", acc.getAccX());
+        pc.printf("%.2f,", acc.getAccY());
+        pc.printf("%.2f,", acc.getAccZ());
+        pc.printf("%.2f,", sensor.getPressure());
+        pc.printf("%.2f", sensor.getTemperature());
+        pc.printf(",ETX\n");
+        wait(0.1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 23 03:29:44 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/c0f6e94411f5
\ No newline at end of file