Naoya Toyozumi / Mbed 2 deprecated Zumipen

Dependencies:   LSM9DS1 mbed

Files at this revision

API Documentation at this revision

Comitter:
tona0516
Date:
Mon Feb 20 07:13:11 2017 +0000
Commit message:
Zumipen

Changed in this revision

LSM9DS1.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/LSM9DS1.lib	Mon Feb 20 07:13:11 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/tona0516/code/LSM9DS1/#8e17d3584f99
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Feb 20 07:13:11 2017 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "LSM9DS1.h"
+
+Serial pc(USBTX, USBRX);
+LSM9DS1 imu(I2C_SDA0, I2C_SCL0);
+Timer timer;
+AnalogIn Analog1(P0_5);
+AnalogIn Analog2(P0_6);
+int acc[3];
+int gyro[3];
+float strain[2];
+
+int main() {
+    pc.baud(115200);
+    timer.start();
+    while(1){
+        imu.getAcceleroRaw(acc);
+        imu.getGyroRaw(gyro);
+        strain[0] = Analog1.read();
+        strain[1] = Analog2.read();
+        pc.printf("%d,%d,%d,%d,%d,%d,%d,%.5f,%.5f",timer.read_ms(),acc[0],acc[1],acc[2],gyro[0],gyro[1],gyro[2],strain[0],strain[1]);
+        pc.printf("\n");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Feb 20 07:13:11 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file