class IMU nucleo
Dependents: Coupe-Robotique-FIP-Main
Fork of IMU_FIP by
Imu.cpp@2:3088586fe88c, 2015-04-10 (annotated)
- Committer:
- quentin9696
- Date:
- Fri Apr 10 16:38:46 2015 +0000
- Revision:
- 2:3088586fe88c
- Parent:
- 1:eb79df94d147
- Child:
- 3:89e327e1217f
bug solved : volatile grrr
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
quentin9696 | 0:528e23a13fb7 | 1 | #include "mbed.h" |
quentin9696 | 0:528e23a13fb7 | 2 | #include "x_cube_mems.h" |
quentin9696 | 0:528e23a13fb7 | 3 | #include "Imu.h" |
quentin9696 | 0:528e23a13fb7 | 4 | #include "x_cube_mems_i2c.h" |
quentin9696 | 0:528e23a13fb7 | 5 | |
quentin9696 | 0:528e23a13fb7 | 6 | Imu::Imu() { |
quentin9696 | 0:528e23a13fb7 | 7 | |
quentin9696 | 0:528e23a13fb7 | 8 | TEMPERATURE_Value_C = 0.0f; |
quentin9696 | 0:528e23a13fb7 | 9 | HUMIDITY_Value = 0.0f; |
quentin9696 | 0:528e23a13fb7 | 10 | PRESSURE_Value = 0.0f; |
quentin9696 | 2:3088586fe88c | 11 | MAG_Value = new AxesRaw_TypeDef(); |
quentin9696 | 2:3088586fe88c | 12 | ACC_Value = new AxesRaw_TypeDef(); |
quentin9696 | 2:3088586fe88c | 13 | GYR_Value = new AxesRaw_TypeDef(); |
quentin9696 | 0:528e23a13fb7 | 14 | |
quentin9696 | 0:528e23a13fb7 | 15 | } |
quentin9696 | 0:528e23a13fb7 | 16 | |
quentin9696 | 0:528e23a13fb7 | 17 | float Imu::getHUM() { |
quentin9696 | 0:528e23a13fb7 | 18 | return HUMIDITY_Value; |
quentin9696 | 0:528e23a13fb7 | 19 | } |
quentin9696 | 0:528e23a13fb7 | 20 | |
quentin9696 | 0:528e23a13fb7 | 21 | float Imu::getTEMP() { |
quentin9696 | 0:528e23a13fb7 | 22 | return TEMPERATURE_Value_C; |
quentin9696 | 0:528e23a13fb7 | 23 | } |
quentin9696 | 0:528e23a13fb7 | 24 | |
quentin9696 | 0:528e23a13fb7 | 25 | float Imu::getPRES() { |
quentin9696 | 0:528e23a13fb7 | 26 | return PRESSURE_Value; |
quentin9696 | 0:528e23a13fb7 | 27 | } |
quentin9696 | 0:528e23a13fb7 | 28 | |
quentin9696 | 0:528e23a13fb7 | 29 | AxesRaw_TypeDef * Imu::getMAG() { |
quentin9696 | 2:3088586fe88c | 30 | |
quentin9696 | 2:3088586fe88c | 31 | return MAG_Value; |
quentin9696 | 0:528e23a13fb7 | 32 | } |
quentin9696 | 0:528e23a13fb7 | 33 | |
quentin9696 | 0:528e23a13fb7 | 34 | AxesRaw_TypeDef * Imu::getACC() { |
quentin9696 | 0:528e23a13fb7 | 35 | return ACC_Value; |
quentin9696 | 0:528e23a13fb7 | 36 | } |
quentin9696 | 0:528e23a13fb7 | 37 | |
quentin9696 | 0:528e23a13fb7 | 38 | AxesRaw_TypeDef * Imu::getGYR() { |
quentin9696 | 0:528e23a13fb7 | 39 | return GYR_Value; |
quentin9696 | 0:528e23a13fb7 | 40 | } |