# lv_led.h (/api/public/widgets/lv_led_h)



<RelatedHeaders name="lv_led_private.h" isPrivate="false" />

<ApiSummary functions="8" enums="1" macros="2" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (2)&#x22;,&#x22;Getters (2)&#x22;,&#x22;Other (4)&#x22;]">
  <ApiTab value="Setters (2)">
    <ApiMember kind="function" name="lv_led_set_color" file="public/widgets/lv_led.h" line="64" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L64">
      lv_led_set_color [#lv_led_set_color]

      Set the color of the LED

      ```c title=" " lineNumbers=1
      void lv_led_set_color(lv_obj_t *obj, lv_color_t color)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description             |
      | ------- | ------------------------------------------------ | ----------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object |
      | `color` | <ApiLink name="lv_color_t" />                    | the color of the LED    |
    </ApiMember>

    <ApiMember kind="function" name="lv_led_set_brightness" file="public/widgets/lv_led.h" line="71" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L71">
      lv_led_set_brightness [#lv_led_set_brightness]

      Set the brightness of a LED object

      ```c title=" " lineNumbers=1
      void lv_led_set_brightness(lv_obj_t *obj, uint8_t bright)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                            |
      | -------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `obj`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object                                                |
      | `bright` | `uint8_t`                                        | LV\_LED\_BRIGHT\_MIN (max. dark) ... LV\_LED\_BRIGHT\_MAX (max. light) |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_led_get_brightness" file="public/widgets/lv_led.h" line="96" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L96">
      lv_led_get_brightness [#lv_led_get_brightness]

      Get the brightness of a LED object

      ```c title=" " lineNumbers=1
      uint8_t lv_led_get_brightness(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description           |
      | ----- | ------------------------------------------------------ | --------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to LED object |

      **Returns:** `uint8_t` — bright 0 (max. dark) ... 255 (max. light)
    </ApiMember>

    <ApiMember kind="function" name="lv_led_get_color" file="public/widgets/lv_led.h" line="103" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L103">
      lv_led_get_color [#lv_led_get_color]

      Get the color of a LED object

      ```c title=" " lineNumbers=1
      lv_color_t lv_led_get_color(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description           |
      | ----- | ------------------------------------------------------ | --------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | pointer to LED object |

      **Returns:** <ApiLink name="lv_color_t" /> — color color of the LED
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (4)">
    <ApiMember kind="function" name="lv_led_create" file="public/widgets/lv_led.h" line="57" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L57">
      lv_led_create [#lv_led_create]

      Create a led object

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_led_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                                                                         |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the default display. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created led
    </ApiMember>

    <ApiMember kind="function" name="lv_led_on" file="public/widgets/lv_led.h" line="77" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L77">
      lv_led_on [#lv_led_on]

      Light on a LED

      ```c title=" " lineNumbers=1
      void lv_led_on(lv_obj_t *led)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description             |
      | ----- | ------------------------------------------------ | ----------------------- |
      | `led` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object |
    </ApiMember>

    <ApiMember kind="function" name="lv_led_off" file="public/widgets/lv_led.h" line="83" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L83">
      lv_led_off [#lv_led_off]

      Light off a LED

      ```c title=" " lineNumbers=1
      void lv_led_off(lv_obj_t *led)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description             |
      | ----- | ------------------------------------------------ | ----------------------- |
      | `led` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object |
    </ApiMember>

    <ApiMember kind="function" name="lv_led_toggle" file="public/widgets/lv_led.h" line="89" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L89">
      lv_led_toggle [#lv_led_toggle]

      Toggle the state of a LED

      ```c title=" " lineNumbers=1
      void lv_led_toggle(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description             |
      | ----- | ------------------------------------------------ | ----------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_led_id_t" file="public/widgets/lv_led.h" line="40" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L40">
  \_lv_property_led_id_t [#_lv_property_led_id_t]

  | Name                         | Value                                                        |
  | ---------------------------- | ------------------------------------------------------------ |
  | `LV_PROPERTY_LED_COLOR`      | `(LV_PROPERTY_LED_START + ((int) 0 )) \| ((  3   ) <<  28 )` |
  | `LV_PROPERTY_LED_BRIGHTNESS` | `(LV_PROPERTY_LED_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_LED_END`        |                                                              |
</ApiMember>

Macros [#macros]

<ApiMember kind="macro" name="LV_LED_BRIGHT_MIN" file="public/widgets/lv_led.h" line="25" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L25">
  LV_LED_BRIGHT_MIN [#lv_led_bright_min]

  ```c title=" " lineNumbers=1
  #define LV_LED_BRIGHT_MIN 80
  ```

  Brightness when the LED if OFF
</ApiMember>

<ApiMember kind="macro" name="LV_LED_BRIGHT_MAX" file="public/widgets/lv_led.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L30">
  LV_LED_BRIGHT_MAX [#lv_led_bright_max]

  ```c title=" " lineNumbers=1
  #define LV_LED_BRIGHT_MAX 255
  ```

  Brightness when the LED if ON
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_led_class" file="public/widgets/lv_led.h" line="37" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_led.h#L37">
  lv_led_class [#lv_led_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_led_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
