1.. _tmd2620:
2
3Generic Proximity Sensor Sample
4###############################
5
6Overview
7********
8
9This sample demonstrates how to use one or multiple proximity sensors.
10
11Building and Running
12********************
13
14The sample supports up to 10 proximity sensors. The number of the sensors will
15automatically detected from the devicetree, you only need to set aliases from
16``prox-sensor-0`` to ``prox-sensor-9``.
17
18For example:
19
20.. code-block:: devicetree
21
22   / {
23              aliases {
24                      prox-sensor0 = &tmd2620;
25              };
26   };
27
28After creating the devicetree overlay you can build the sample with:
29
30.. zephyr-app-commands::
31   :zephyr-app: samples/sensor/proximity_polling
32   :board: <your_board>
33   :goals: build flash
34   :compact:
35
36Sample Output
37=============
38
39.. code-block:: console
40
41   *** Booting Zephyr OS build zephyr-v3.2.0-210-gd95295f08646  ***
42   Proximity sensor sample application
43   Found 1 proximity sensor(s): tmd2620@29
44   Proximity on tmd2620@29: 202
45   Proximity on tmd2620@29: 205
46   Proximity on tmd2620@29: 204
47   Proximity on tmd2620@29: 60
48   Proximity on tmd2620@29: 1
49