How to use =========== .. toctree:: :maxdepth: 3 :caption: Contents: Platform support ---------------- Framework: - Arduino This library is made to be used with: - All Necessary inclusions -------------------- Only the header has to be included to you project .. code-block:: c++ #include "libDM_icm42688.hpp" Object creation --------------- The library supports only SPI reading. The following example shows how to create the object: .. important:: API ref: :cpp:class:`ICM42688_SPI` .. code-block:: c++ ICM42688_SPI icm(generalConf.icmSpiClock, pinConf.pinSS, &SPI, ABSTRACT_SENSOR_SPI::SPI_CONF(), true, true); Object configuration -------------------- The best way to use to the sensor is with the Fifo activated. The following example shows how to configure the sensor to use it: .. important:: API ref: :cpp:func:`ICM42688_SPI::softResetSensor`, :cpp:func:`ICM42688_SPI::setGyroOdrRange`, :cpp:func:`ICM42688_SPI::setAccOdrRange`, :cpp:func:`ICM42688_SPI::setGyroAccelFilter`, :cpp:func:`ICM42688_SPI::flushFifo` .. code-block:: c++ :linenos: icm.softResetSensor(); icm.begin(); icm.setGyroOdrRange(ICM42688_ENUM::ODR::_1kHz, ICM42688_ENUM::GYRO_RANGE::_2000dps); icm.setAccOdrRange(ICM42688_ENUM::ODR::_1kHz, ICM42688_ENUM::ACC_RANGE::_16g); icm.setGyroAccelFilter(ICM42688_ENUM::FILTER_BW::ODR_DIV_4, ICM42688_ENUM::FILTER_BW::ODR_DIV_4, ICM42688_ENUM::FILTER_ORDER::_2nd_ORDER, ICM42688_ENUM::FILTER_ORDER::_2nd_ORDER); delay(100); if (icm.checkImmobility(0.3F, 200U, 1U, 1000U)) icm.calibGyro(2000); icm.flushFifo(true); delay(100); Get data -------- The following example shows how to get the data from the sensor: .. important:: API ref: :cpp:func:`ICM42688_SPI::readFifo` .. code-block:: c++ :linenos: ABSTRACT_IMU::IMU_OUTPUT resIMU; icm.readFifo(); resIMU = icm.getOutput();