1.. _fxos8700: 2 3FXOS8700 Accelerometer/Magnetometer Sensor 4########################################## 5 6Overview 7******** 8 9This sample application shows how to use the FXOS8700 driver. 10The driver supports FXOS8700 accelerometer/magnetometer and 11MMA8451Q, MMA8652FC, MMA8653FC accelerometers. 12 13Building and Running 14******************** 15 16This project outputs sensor data to the console. FXOS8700 17sensor is present on the :ref:`frdm_k64f`, :ref:`frdm_k22f`, 18:ref:`frdm_kw41z`, :ref:`hexiwear_k64`, and :ref:`twr_ke18f` boards. 19Accelerometer only devices are present on the :ref:`frdm_kl25z`, 20:ref:`bbc_microbit`, and :ref:`reel_board` boards. It does not work on 21QEMU. 22 23Building and Running for FRDM-K64F 24================================== 25FRDM-K64F is equipped with FXOS8700CQ accelerometer and magnetometer. 26Sample can be built and executed for the FRDM-K64F as follows: 27 28.. zephyr-app-commands:: 29 :zephyr-app: samples/sensor/fxos8700 30 :board: frdm_k64f 31 :goals: build flash 32 :compact: 33 34Example building for the FRDM-K64F with motion detection support: 35 36.. zephyr-app-commands:: 37 :zephyr-app: samples/sensor/fxos8700 38 :board: frdm_k64f 39 :conf: "prj.conf overlay-motion.conf" 40 :goals: build flash 41 :compact: 42 43Building and Running for FRDM-K22F 44================================== 45FRDM-K22F is equipped with FXOS8700CQ accelerometer and magnetometer. 46Sample can be built and executed for the FRDM-K22F as follows: 47 48.. zephyr-app-commands:: 49 :zephyr-app: samples/sensor/fxos8700 50 :board: frdm_k22f 51 :goals: build flash 52 :compact: 53 54Example building for the FRDM-K22F with motion detection support: 55 56.. zephyr-app-commands:: 57 :zephyr-app: samples/sensor/fxos8700 58 :board: frdm_k22f 59 :conf: "prj.conf overlay-motion.conf" 60 :goals: build flash 61 :compact: 62 63Building and Running for TWR-KE18F 64================================== 65TWR-KE18F is equipped with FXOS8700CQ accelerometer and magnetometer. 66The FXOS8700CQ IRQ lines, however, are not connected by default, so 67motion detection is not supported. 68 69Sample can be built and executed for the TWR-KE18F as follows: 70 71.. zephyr-app-commands:: 72 :zephyr-app: samples/sensor/fxos8700 73 :board: twr_ke18f 74 :goals: build flash 75 :compact: 76 77Building and Running for FRDM-KL25Z 78=================================== 79FRDM-KL25Z is equipped with MMA8451Q accelerometer. 80Sample can be built and executed for the FRDM-KL25Z as follows: 81 82.. zephyr-app-commands:: 83 :zephyr-app: samples/sensor/fxos8700 84 :board: frdm_kl25z 85 :conf: "prj_accel.conf" 86 :goals: build flash 87 :compact: 88 89Building and Running for Micro Bit 90================================== 91Micro Bit is equipped with MMA8653FC accelerometer. 92Sample can be built and executed for the Micro Bit as follows: 93 94.. zephyr-app-commands:: 95 :zephyr-app: samples/sensor/fxos8700 96 :board: bbc_microbit 97 :conf: "prj_accel.conf" 98 :goals: build flash 99 :compact: 100 101Building and Running for reel board 102=================================== 103The reel board is equipped with MMA8652FC accelerometer. 104Sample can be built and executed for the reel board as follows: 105 106.. zephyr-app-commands:: 107 :zephyr-app: samples/sensor/fxos8700 108 :board: reel_board 109 :conf: "prj_accel.conf" 110 :goals: build flash 111 :compact: 112 113Building and Running for MIMXRT685-EVK 114====================================== 115MIMXRT685-EVK is equipped with FXOS8700CQ accelerometer and magnetometer. 116Sample can be built and executed for the MIMXRT685-EVK as follows: 117 118.. zephyr-app-commands:: 119 :zephyr-app: samples/sensor/fxos8700 120 :board: mimxrt685_evk_cm33 121 :goals: build flash 122 :compact: 123 124Sample Output 125============= 126 127.. code-block:: console 128 129 AX= -0.191537 AY= 0.067037 AZ= 9.902418 MX= 0.379000 MY= 0.271000 MZ= -0.056000 T= 22.080000 130 AX= -0.162806 AY= 0.143652 AZ= 9.940725 MX= 0.391000 MY= 0.307000 MZ= -0.058000 T= 22.080000 131 AX= -0.172383 AY= 0.134075 AZ= 9.969455 MX= 0.395000 MY= 0.287000 MZ= -0.017000 T= 22.080000 132 AX= -0.210690 AY= 0.105344 AZ= 9.911994 MX= 0.407000 MY= 0.306000 MZ= -0.068000 T= 22.080000 133 AX= -0.153229 AY= 0.124498 AZ= 9.950302 MX= 0.393000 MY= 0.301000 MZ= -0.021000 T= 22.080000 134 AX= -0.153229 AY= 0.095768 AZ= 9.921571 MX= 0.398000 MY= 0.278000 MZ= -0.040000 T= 22.080000 135 AX= -0.162806 AY= 0.105344 AZ= 9.902418 MX= 0.372000 MY= 0.300000 MZ= -0.046000 T= 22.080000 136 137<repeats endlessly> 138