Simple application to test ST motion and environmental MEMS sensors. Supports NUCLEO+X-NUCLEO-IKS01A2 , STEVAL-STLKT01V1 (a.k.a. SensorTile) and B-L475E-IOT01A boards.
Dependencies: HTS221 LIS3MDL LPS22HB LSM303AGR LSM6DSL VL53L0X
Supports NUCLEO+X-NUCLEO-IKS01A2 , STEVAL-STLKT01V1 (a.k.a. SensorTile) and B-L475E-IOT01A boards.
Diff: main.cpp
- Revision:
- 2:4d4fa82dbc59
- Parent:
- 1:0f7838527fef
- Child:
- 3:82e8968382d6
diff -r 0f7838527fef -r 4d4fa82dbc59 main.cpp --- a/main.cpp Fri Sep 08 12:22:48 2017 +0000 +++ b/main.cpp Wed Sep 27 16:51:31 2017 +0200 @@ -55,18 +55,19 @@ #ifdef TARGET_DISCO_L475VG_IOT01A static DevI2C devI2c = DevI2C(PB_11,PB_10); #else // X-Nucleo-IKS01A2 -static DevI2C devI2c = DevI2C(D14,D15); +static DevI2C devI2c(D14,D15); #endif -static HTS221Sensor hum_temp = HTS221Sensor(devI2c); -static LPS22HBSensor press_temp = LPS22HBSensor(devI2c); +//static HTS221Sensor hum_temp = HTS221Sensor(&devI2c); +static HTS221Sensor hum_temp(&devI2c); +static LPS22HBSensor press_temp(&devI2c); #ifdef TARGET_DISCO_L475VG_IOT01A -static LSM6DSLSensor acc_gyro = LSM6DSLSensor(devI2c,PD_11,NC,LSM6DSL_ACC_GYRO_I2C_ADDRESS_LOW); // low address -static LIS3MDL magnetometer = LIS3MDL(devI2c); +static LSM6DSLSensor acc_gyro(&devI2c,PD_11,NC,LSM6DSL_ACC_GYRO_I2C_ADDRESS_LOW); // low address +static LIS3MDL magnetometer(&devI2c); #else // X-NUCLEO_IKS01A2 -static LSM6DSLSensor acc_gyro = LSM6DSLSensor(devI2c,D4,D5); // high address (default) -static LSM303AGRMagSensor magnetometer = LSM303AGRMagSensor(devI2c); +static LSM6DSLSensor acc_gyro(&devI2c,D4,D5); // high address (default) +static LSM303AGRMagSensor magnetometer(&devI2c); #endif /* Helper function for printing floats & doubles */