1.. zephyr:code-sample:: accel_polling 2 :name: Generic 3-Axis accelerometer polling 3 :relevant-api: sensor_interface 4 5 Get 3-Axis accelerometer data from a sensor (polling mode). 6 7Overview 8******** 9 10This sample application demonstrates how to use 3-Axis accelerometers. 11 12Building and Running 13******************** 14 15This sample supports up to 10 3-Axis accelerometers. Each accelerometer needs 16to be aliased as ``accelN`` where ``N`` goes from ``0`` to ``9``. For example: 17 18.. code-block:: devicetree 19 20 / { 21 aliases { 22 accel0 = &lis2dh; 23 }; 24 }; 25 26Make sure the aliases are in devicetree, then build and run with: 27 28.. zephyr-app-commands:: 29 :zephyr-app: samples/sensor/accel_polling 30 :board: <board to use> 31 :goals: build flash 32 :compact: 33 34Sample Output 35============= 36 37.. code-block:: console 38 39 lis2dh@19 [m/s^2]: ( -6.013728, -3.064320, 7.277760) 40 lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.201152) 41 lis2dh@19 [m/s^2]: ( -6.090336, -3.064320, 7.162848) 42 lis2dh@19 [m/s^2]: ( -6.128640, -3.026016, 7.354368) 43 lis2dh@19 [m/s^2]: ( -6.166944, -3.102624, 7.277760) 44 lis2dh@19 [m/s^2]: ( -6.128640, -2.987712, 7.277760) 45 lis2dh@19 [m/s^2]: ( -6.052032, -2.987712, 7.277760) 46 lis2dh@19 [m/s^2]: ( -6.166944, -2.987712, 7.239456) 47 lis2dh@19 [m/s^2]: ( -6.090336, -3.026016, 7.201152) 48