TheBeauGosse
/
LSM6DS33
Toute les bases des 10 axes
Revision 0:6f5e9ca12899, committed 2019-03-21
- Comitter:
- MaxLaMenace
- Date:
- Thu Mar 21 11:50:07 2019 +0000
- Commit message:
- Nothing
Changed in this revision
--- /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*
--- /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
--- /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
--- /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