Arduino library to support the LIS2DUXS12 3D accelerometer
This sensor uses I2C to communicate. For I2C it is then required to create a TwoWire interface before accessing to the sensors:
TwoWire dev_i2c(I2C_SDA, I2C_SCL);
dev_i2c.begin();
An instance can be created and enabled when the I2C bus is used following the procedure below:
LIS2DUXS12Sensor Accelero(&dev_i2c);
Accelero.begin();
Accelero.Enable_X();
The access to the sensor values is done as explained below:
Read accelerometer.
int32_t accelerometer[3];
Accelero.Get_X_Axes(accelerometer);
-
LIS2DUXS12_Double_Tap_Detection: This application shows how to detect the double tap event using the LIS2DUXS12 accelerometer.
-
LIS2DUXS12_Single_Tap_Detection: This application shows how to detect the single tap event using the LIS2DUXS12 accelerometer.
-
LIS2DUXS12_Tilt_Detection: This application shows how to detect the tilt event using the LIS2DUXS12 accelerometer.
-
LIS2DUXS12_Wake_Up_Detection: This application shows how to detect the wake-up event using the LIS2DUXS12 accelerometer.
You can find the source files at
https://github.com/stm32duino/LIS2DUXS12
The LIS2DUXS12 datasheet is available at
https://www.st.com/content/st_com/en/products/mems-and-sensors/accelerometers/LIS2DUXS12.html