stm32duino / LIS2DUXS12

Arduino library to support the LIS2DUXS12 3D ultralow-power accelerometer with QVAR and AI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LIS2DUXS12

Arduino library to support the LIS2DUXS12 3D accelerometer

API

This sensor uses I2C or SPI 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();

For SPI it is then required to create a SPI interface before accessing to the sensors:

SPIClass dev_spi(SPI_MOSI, SPI_MISO, SPI_SCK);  
dev_spi.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();

An instance can be created and enabled when the SPI bus is used following the procedure below:

LIS2DUXS12Sensor Accelero(&dev_spi, CS_PIN);  
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);  

Examples

  • LIS2DUXS12_DataLog_Terminal: This application shows how to get data from LIS2DUXS12 accelerometer and print them on terminal.

  • LIS2DUXS12_6D_Orientation: This application shows how to use LIS2DUXS12 accelerometer to find out the 6D orientation and display data on a hyperterminal.

  • LIS2DUXS12_Double_Tap_Detection: This application shows how to detect the double tap event using the LIS2DUXS12 accelerometer.

  • LIS2DUXS12_FIFO_Polling: This application shows how to get accelerometer data from FIFO in pooling mode and print them on terminal.

  • LIS2DUXS12_FIFO_Interrupt: This application shows how to get accelerometer data from FIFO using interrupt and print them on terminal.

  • LIS2DUXS12_Free_Fall_Detection: This application shows how to detect the free fall event using the LIS2DUXS12 accelerometer.

  • LIS2DUXS12_MLC: This application shows how to detect the activity using the LIS2DUXS12 Machine Learning Core.

  • LIS2DUXS12_Pedometer: This application shows how to use LIS2DUXS12 accelerometer to count steps.

  • LIS2DUXS12_Qvar_Polling: This application shows how to use LIS2DUXS12 Qvar features in polling mode.

  • 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_Triple_Tap_Detection: This application shows how to detect the triple tap event using the LIS2DUXS12 accelerometer.

  • LIS2DUXS12_Wake_Up_Detection: This application shows how to detect the wake-up event using the LIS2DUXS12 accelerometer.

Documentation

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

About

Arduino library to support the LIS2DUXS12 3D ultralow-power accelerometer with QVAR and AI

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C 67.1%Language:C++ 32.9%