Lines Matching +full:blue +full:- +full:pwm +full:- +full:led
1 .. zephyr:code-sample:: rgb-led
2 :name: PWM RGB LED
3 :relevant-api: pwm_interface
5 Drive an RGB LED using the PWM API.
10 This is a sample app which drives an RGB LED using the :ref:`PWM API <pwm_api>`.
12 There are three single-color component LEDs in an RGB LED. Each component LED
13 is driven by a PWM port where the pulse width is changed from zero to the period
15 flicker fusion threshold (the minimum flicker rate where the LED is perceived as
16 being steady). The sample causes each LED component to step from dark to max
17 brightness. Three **for** loops (one for each component LED) generate a gradual
18 range of color changes from the RGB LED, and the sample repeats forever.
23 The board must have red, green, and blue LEDs connected via PWM output channels.
25 The LED PWM channels must be configured using the following :ref:`devicetree
26 <dt-guide>` aliases, usually in the :ref:`BOARD.dts file
27 <devicetree-in-out-files>`:
29 - ``red-pwm-led``
30 - ``green-pwm-led``
31 - ``blue-pwm-led``
36 .. code-block:: none
38 Unsupported board: red-pwm-led devicetree alias is not defined
39 Unsupported board: green-pwm-led devicetree alias is not defined
40 Unsupported board: blue-pwm-led devicetree alias is not defined
51 Otherwise, LEDs should be connected to the appropriate PWM channels.
58 .. zephyr-app-commands::
59 :zephyr-app: samples/basic/rgb_led