https://github.com/stm32duino/lsm6dso16is
Arduino library to support the LSM6DSO16IS 3D accelerometer and 3D gyroscope with ISPU
https://github.com/stm32duino/lsm6dso16is
Last synced: about 2 months ago
JSON representation
Arduino library to support the LSM6DSO16IS 3D accelerometer and 3D gyroscope with ISPU
- Host: GitHub
- URL: https://github.com/stm32duino/lsm6dso16is
- Owner: stm32duino
- License: bsd-3-clause
- Created: 2023-07-28T12:40:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-22T09:47:47.000Z (over 1 year ago)
- Last Synced: 2024-12-31T12:50:16.282Z (4 months ago)
- Language: C
- Homepage:
- Size: 88.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LSM6DSO16IS
Arduino library to support the LSM6DSO16IS 3D accelerometer and 3D gyroscope with ISPU## 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:
LSM6DSO16ISSensor AccGyr(&dev_i2c);
AccGyr.begin();
AccGyr.Enable_X();
AccGyr.Enable_G();An instance can be created and enabled when the SPI bus is used following the procedure below:
LSM6DSO16ISSensor AccGyr(&dev_spi, CS_PIN);
AccGyr.begin();
AccGyr.Enable_X();
AccGyr.Enable_G();The access to the sensor values is done as explained below:
Read accelerometer and gyroscope.
int32_t accelerometer[3];
int32_t gyroscope[3];
AccGyr.Get_X_Axes(accelerometer);
AccGyr.Get_G_Axes(gyroscope);## Examples
* LSM6DSO16IS_DataLog_Terminal: This application shows how to get data from LSM6DSO16IS accelerometer and gyroscope and print them on terminal.
* LSM6DSO16IS_ISPU_Sensor_Fusion: This application implements the sensor fusion of the accelerometer and gyroscope, configured in high-performance mode at 104 Hz. The configuration generates an interrupt on INT1 when the quaternion for the new sample is computed and available in the output registers.
* LSM6DSO16IS_ISPU_Tap: This application implements the tap detection solution based on the accelerometer data. The configuration generates an interrupt on INT1 when the tap event for the new sample is computed and available in the output registers.
## Documentation
You can find the source files at
https://github.com/stm32duino/LSM6DSO16ISThe LSM6DSO16IS datasheet is available at
https://www.st.com/content/st_com/en/products/mems-and-sensors/inemo-inertial-modules/lsm6dso16is.htmlYou can find other examples on ISPU at
https://github.com/STMicroelectronics/ispu-examples/tree/master/ism330is_lsm6dso16is