nrfx 4.5.0
Loading...
Searching...
No Matches
PWM common mode

PWM common mode

The sample demonstrates a basic functionality of the nrfx_pwm driver for a sequence loaded in the common mode.

Requirements

The sample supports the following development kits:

Board Support Number of LEDs expected to blink
nrf52dk_nrf52832 Yes 4
nrf52833dk_nrf52833 Yes 4
nrf52840dk_nrf52840 Yes 4
nrf5340dk_nrf5340 Yes 4
nrf54l15dk_nrf54l15 Yes 2
nrf9160dk_nrf9160 Yes 4

Overview

Application initializes the nrfx_pwm driver. It plays a simple sequence on LEDs (breathing effect) and replays this sequence NUM_OF_LOOPS times. pwm_handler() is executed with a relevant log message after every loop.

‍For more information, see PWM driver - nrfx documentation.

Wiring

To run this sample, no special configuration is needed. You should monitor the output from the board to check if it is as expected.

Building and running

To run this sample, build it for the appropriate board and then flash it as per instructions in Building and running section.

Sample output

You should see the following output:

- "Starting nrfx_pwm example for sequence loaded in common mode."
- "Loops: 1 / 3"
- "Loops: 2 / 3"
- "Loops: 3 / 3"
- "PWM finished"

Two or four LEDs on the development kit should blink in the following sequence:

PWM common example