Sample code for LSM9DS1 IMU

Dependencies:   mbed LSM9DS1

Revision:
0:e068f5847209
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 07 23:22:46 2019 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "LSM9DS1.h"
+
+
+Serial pc(USBTX,USBRX);
+LSM9DS1 imu(p28,p27);
+
+int main(){
+    imu.begin();
+    while(1){
+        imu.readAccel();
+        imu.readGyro();
+        imu.readMag();
+        pc.printf("Accelerometer: x = %8f, y = %8f, z = %8f\n\r",imu.ax,imu.ay, imu.az);
+        pc.printf("Gyro:          x = %f, y = %f, z = %f\n\r",imu.gx,imu.gy, imu.gz);
+        pc.printf("Magnetometer:  x = %f, y = %f, z = %f\n\n\n\r",imu.mx,imu.my, imu.mz);
+        wait(1);
+    }
+}
\ No newline at end of file