1.. zephyr:code-sample:: led-pwm 2 :name: LED PWM 3 :relevant-api: led_interface 4 5 Control PWM LEDs using the LED API. 6 7Overview 8******** 9 10This sample allows to test the led-pwm driver. The first "pwm-leds" compatible 11device instance found in DT is used. For each LEDs attached to this device 12(child nodes) the same test pattern (described below) is executed. The LED API 13functions are used to control the LEDs. 14 15Test pattern 16============ 17 18For each PWM LEDs (one after the other): 19 20- Turning on 21- Turning off 22- Increasing brightness gradually 23- Decreasing brightness gradually 24- Blinking on: 0.1 sec, off: 0.1 sec 25- Blinking on: 1 sec, off: 1 sec 26- Turning off 27 28Building and Running 29******************** 30 31This sample can be built and executed on all the boards with PWM LEDs connected. 32The LEDs must be correctly described in the DTS: the compatible property of the 33device node must match "pwm-leds". And for each LED, a child node must be 34defined and the PWM configuration must be provided through a "pwms" phandle's 35node. 36