1.. zephyr:code-sample:: w1-scanner
2   :name: 1-Wire scanner
3   :relevant-api: w1_interface
4
5   Scan for 1-Wire devices and print their family ID and serial number.
6
7Overview
8********
9
10This sample demonstrates how to scan for 1-Wire devices. It runs the 1-Wire
11scan routine once and prints the family id as well as serial number of the
12devices found.
13
14Building and Running
15********************
16
17Set DTC_OVERLAY_FILE to "ds2484.overlay" or "w1_serial.overlay" in order to
18enable and configure the drivers.
19
20.. zephyr-app-commands::
21   :zephyr-app: samples/drivers/w1/scanner
22   :board: nrf52840dk/nrf52840
23   :gen-args: -DDTC_OVERLAY_FILE=w1_serial.overlay
24   :goals: build flash
25   :compact:
26
27Sample Output
28=============
29
30.. code-block:: console
31
32    [00:00:00.392,272] <inf> main: Device found; family: 0x3a, serial: 0x3af9985800000036
33    [00:00:00.524,169] <inf> main: Device found; family: 0x3a, serial: 0x3a6ea2580000003b
34    [00:00:00.656,097] <inf> main: Device found; family: 0x28, serial: 0x2856fb470d000022
35    [00:00:00.656,097] <inf> main: Number of devices found on bus: 3
36