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