using the i2c from yang's library i used nxp lpc1768

Dependencies:   LSM6DS3 mbed

Files at this revision

API Documentation at this revision

Comitter:
oreo329
Date:
Thu Apr 13 16:11:55 2017 +0000
Commit message:
LSM6DS3 I2C successful & serial monitor with teraterm

Changed in this revision

LSM6DS3.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 ede57b616ea7 LSM6DS3.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LSM6DS3.lib	Thu Apr 13 16:11:55 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/5hel2l2y/code/LSM6DS3/#ed14e6196255
diff -r 000000000000 -r ede57b616ea7 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 13 16:11:55 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "LSM6DS3.h"
+
+Serial pc(USBTX, USBRX); // tx, rx
+LSM6DS3 LSM6DS3(p28,p27);
+
+int main() {
+   
+    LSM6DS3.begin();
+    
+    while(1)
+    {
+        //read Accel & Gyro
+        LSM6DS3.readAccel();
+        LSM6DS3.readGyro();
+        
+        //serial send Accel
+        pc.printf("AccelerX[%f]\n",LSM6DS3.ax);
+        pc.printf("AccelerY[%f]\n",LSM6DS3.ay);
+        pc.printf("AccelerZ[%f]\n",LSM6DS3.az);
+        
+        //serial send Gyro
+        pc.printf("GyroX[%f]\n",LSM6DS3.gx);
+        pc.printf("GyroY[%f]\n",LSM6DS3.gy);
+        pc.printf("GyroZ[%f]\n",LSM6DS3.gz);
+        
+    }
+   
+}
\ No newline at end of file
diff -r 000000000000 -r ede57b616ea7 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 13 16:11:55 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10
\ No newline at end of file