1.. _lsm303dlhc: 2 3LSM303DLHC: Magnetometer and Accelerometer data Monitor 4####################################################### 5 6Overview 7******** 8This sample application periodically reads magnetometer and accelerometer data 9from the LSM303DLHC eCompass module's sensors, and displays the sensor data 10on the console. 11 12Requirements 13************ 14 15This sample uses the LSM303DLHC, ST MEMS system-in-package featuring a 163D digital linear acceleration sensor and a 3D digital magnetic sensor, 17controlled using the I2C interface. 18 19References 20********** 21 22For more information about the LSM303DLHC eCompass module, see 23https://www.st.com/en/mems-and-sensors/lsm303dlhc.html 24 25Building and Running 26******************** 27 28This project outputs sensor data to the console. It requires a LSM303DLHC 29system-in-package, which is present on the stm32f3_disco board 30 31.. zephyr-app-commands:: 32 :zephyr-app: samples/sensor/lsm303dlhc 33 :board: stm32f3_disco 34 :goals: build 35 :compact: 36 37Sample Output 38============= 39 40.. code-block:: console 41 42 Magnetometer data: 43 ( x y z ) = ( 0.531818 -0.435454 -0.089090 ) 44 Accelerometer data: 45 ( x y z ) = ( -0.078127 -0.347666 1.105502 ) 46 Magnetometer data: 47 ( x y z ) = ( -0.003636 0.297272 -0.255454 ) 48 Accelerometer data: 49 ( x y z ) = ( 0.074221 -0.304696 0.972685 ) 50 51 <repeats endlessly every 2 seconds> 52