Toute les bases des 10 axes

Dependencies:   mbed LSM6DS33

Files at this revision

API Documentation at this revision

Comitter:
MaxLaMenace
Date:
Thu Mar 21 11:50:07 2019 +0000
Commit message:
Nothing

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
LSM6DS33.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 6f5e9ca12899 .gitignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Thu Mar 21 11:50:07 2019 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
diff -r 000000000000 -r 6f5e9ca12899 LSM6DS33.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LSM6DS33.lib	Thu Mar 21 11:50:07 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/bclaus/code/LSM6DS33/#4e7d663e26bd
diff -r 000000000000 -r 6f5e9ca12899 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 21 11:50:07 2019 +0000
@@ -0,0 +1,36 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2018 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#include "LSM6DS33.h"
+
+LSM6DS33 acc = LSM6DS33(I2C_SDA, I2C_SCL);
+
+float axx;
+float ayy; 
+float azz;
+float vx;
+float vy;
+float V;
+
+int main()
+{
+    vx = 0;
+    vy = 0;
+    acc.begin();
+    while (1) {
+    acc.readAccel();
+    axx = acc.ax; 
+    ayy = acc.ay; 
+    azz = acc.az; 
+    vx = vx + axx*9.8*1/104;
+    vy = vy + ayy*9.8*1/104;
+    V = sqrt(vx*vx+vy*vy);
+    
+    printf("acceleration en V = %f\n", V);
+    //printf("acceleration en y = %f\n", ayy);
+    //printf("acceleration en z = %f\n", azz); 
+    //wait(0.5);
+}
+}
\ No newline at end of file
diff -r 000000000000 -r 6f5e9ca12899 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 21 11:50:07 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file