- Notifications
You must be signed in to change notification settings - Fork 1k
LIS3MDL
Arduino library to support the LIS3MDL high-performance 3-axis magnetometer.
LIS3MDLSensor(TwoWire*, uint8_t): class constructor
Params pointer to the I2C instance
Params (optional) address of the component's instanceEnable: enable sensor
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseDisable: disable sensor
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseReadID(uint8_t*): read ID address
Params pointer where store the ID of the device
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseGetAxes(int32_t*): read magnetometer data
Params pointer where to store data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseGetSensitivity(float*): read magnetometer sensitivity
Params pointer where to store data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseGetAxesRaw(int16_t*): read magnetometer raw data
Params pointer where to store data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseGetODR(float*): get the output data rate mode
Params pointer where to store data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseSetODR(float): set the output data rate mode
Params data rate to be set
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseGetFS(float*): get the magnetometer full scale
Params pointer where to store data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseSetFS(float): set the magnetometer full scale
Params full scale to be set
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseReadReg(uint8_t, uint8_t*): read data from register
Params register address
Params pointer to register data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwiseWriteReg(uint8_t, uint8_t): write data to register
Params register address
Params register data
Returns LIS3MDL_STATUS_OK in case of success, an error code otherwise
Note
This library uses the Wire library presents in the STM32 core by default.
- DISCO_IOT_LIS3MDL_DataLog_Terminal: reads magnetometer axes values and prints them.
You can find the source files at
https://.com/stm32duino/LIS3MDL
The LIS3MDL datasheet is available at
http://www.st.com/content/st_com/en/products/mems-and-sensors/e-compasses/lis3mdl.html