1.. zephyr:code-sample:: ht16k33
2   :name: HT16K33 LED driver with keyscan
3   :relevant-api: led_interface kscan_interface
4
5   Control up to 128 LEDs connected to an HT16K33 LED driver and log keyscan events.
6
7Overview
8********
9
10This sample controls the LEDs connected to a `Holtek HT16K33`_
11driver. The sample supports up to 128 LEDs connected to the
12rows/columns of the HT16K33.
13
14The LEDs are controlled using the following pattern:
15
16 1. turn on all connected (up to 128) LEDs one-by-one
17 2. blink the LEDs at 2 Hz, 1 Hz, and 0.5 Hz
18 3. reduce the brightness gradually from 100% to 0%
19 4. turn off all LEDs, restore 100% brightness, and start over
20
21The sample logs keyscan events on the console.
22
23Building and Running
24********************
25
26Build the application for the :ref:`nrf52840dk_nrf52840` board, and
27connect an HT16K33 LED driver at address 0x70 on the I2C-0 bus.
28
29.. zephyr-app-commands::
30   :zephyr-app: samples/drivers/ht16k33
31   :board: nrf52840dk_nrf52840
32   :goals: build
33   :compact:
34
35For flashing the application, refer to the Flashing section of the
36:ref:`nrf52840dk_nrf52840` board documentation.
37
38References
39**********
40
41.. target-notes::
42
43.. _Holtek HT16K33: http://www.holtek.com/productdetail/-/vg/HT16K33
44