Code for Altimu10v4, reads all the i2c sensor and display its values trught serial.

Dependencies:   L3GD20 LPS25H LSM303D mbed

Files at this revision

API Documentation at this revision

Comitter:
renanbmx123
Date:
Sat Jun 16 03:27:53 2018 +0000
Commit message:
First commit of Altimu10v4.

Changed in this revision

L3GD20.lib Show annotated file Show diff for this revision Revisions of this file
LPS25H.lib Show annotated file Show diff for this revision Revisions of this file
LSM303D.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/L3GD20.lib	Sat Jun 16 03:27:53 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/bclaus/code/L3GD20/#b45dbca259f8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LPS25H.lib	Sat Jun 16 03:27:53 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/kenjiArai/code/LPS25H/#9db35e42ddbc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LSM303D.lib	Sat Jun 16 03:27:53 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/bclaus/code/LSM303D/#8cd0c3c11b48
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jun 16 03:27:53 2018 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+#include "L3GD20.h"
+#include "LSM303D.h"
+#include "LPS25H.h"
+
+I2C i2c(p28,p27);
+
+L3GD20 gyro(p28, p27);
+LSM303D lsm(p28, p27);
+LPS25H baro(i2c, LPS25H_V_CHIP_ADDR);
+
+Serial pc(USBTX,USBRX);
+
+
+int main(){
+  
+  float g[3];
+  float acc[3] ,mag[3];
+  pc.baud(9600);
+
+  while (1){
+
+    //Gyroscope
+    gyro.read(&g[0],&g[1],&g[2]);
+    pc.printf("Gyro-> X:%f Y:%f Z:%f\n",g[0] ,g[1] ,g[2]);
+    //Acell/Mag
+    if (lsm.read(&acc[0],&acc[1],&acc[2],&mag[0],&mag[1],&mag[2]))
+    {
+      pc.printf("Acc-> X:%.3f Y%.3f Z%.3f\nMag-> X%3f Y%3f Z%3f)\n",acc[0],acc[1],acc[2],mag[0],mag[1],mag[2]);
+    }
+    //Barometer
+    baro.get();
+    pc.printf("Pres:%6.1fpa\nTemp: %4.1fc\n", baro.pressure(), baro.temperature());      
+    wait(0.5);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jun 16 03:27:53 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file