• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/03-Apr-2024-54

src/03-Apr-2024-6343

CMakeLists.txtD03-Apr-2024190 85

README.rstD03-Apr-20241.1 KiB3927

prj.confD03-Apr-202469 54

sample.yamlD03-Apr-2024258 1312

README.rst

1.. zephyr:code-sample:: fade-led
2   :name: Fade LED
3   :relevant-api: pwm_interface
4
5   Fade an LED using the PWM API.
6
7Overview
8********
9
10This application "fades" a LED using the :ref:`PWM API <pwm_api>`.
11
12The LED starts off increases its brightness until it is fully or nearly fully
13on. The brightness then decreases until the LED is off, completing on fade
14cycle. Each cycle takes 2.5 seconds, and the cycles repeat forever. The PWM
15period is taken from Devicetree. It should be fast enough to be above the
16flicker fusion threshold.
17
18Requirements and Wiring
19***********************
20
21This sample has the same requirements and wiring considerations as the
22:zephyr:code-sample:`pwm-blinky` sample.
23
24Building and Running
25********************
26
27To build and flash this sample for the :ref:`nrf52840dk_nrf52840`:
28
29.. zephyr-app-commands::
30   :zephyr-app: samples/basic/fade_led
31   :board: nrf52840dk_nrf52840
32   :goals: build flash
33   :compact:
34
35Change ``nrf52840dk_nrf52840`` appropriately for other supported boards.
36
37After flashing, the sample starts fading the LED as described above. It also
38prints information to the board's console.
39