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_mmc5983ma.hpp" Object creation --------------- The library supports only SPI reading. The following example shows how to create the object: .. important:: API ref: :cpp:class:`MMC5983MA_SPI` .. code-block:: c++ streamLogger streamObj(&myTimer, sdioConf); MMC5983MA_SPI mmc(generalConf.mmcSpiClock, pinConf.pinMmcSS, &SPI, ABSTRACT_SENSOR_SPI::SPI_CONF()); Object configuration -------------------- The following example shows how to configure the sensor to use it: .. important:: API ref: :cpp:func:`MMC5983MA_SPI::softResetSensor`, :cpp:func:`MMC5983MA_SPI::setMagOdrBw`, :cpp:func:`MMC5983MA_SPI::setAutoSetResetState` .. code-block:: c++ :linenos: mmc.softResetSensor(); delay(10); mmc.begin(); mmc.setMagOdrBw(MMC5983MA_ENUM::ODR::_100HZ, MMC5983MA_ENUM::BW::_200HZ); mmc.setAutoSetResetState(true); Get data -------- The following example shows how to get the data from the sensor: .. code-block:: c++ :linenos: ABSTRACT_MAG::MAG_OUTPUT resMAG; mmc.readMag(); resMAG = mmc.getOutput();