# lv_led.h (/api/widgets/led/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="widgets/led/lv_led.h" line="63" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L63">
      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 *led, lv_color_t color)
      ```

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

      | Name    | Type                                             | Description             |
      | ------- | ------------------------------------------------ | ----------------------- |
      | `led`   | <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="widgets/led/lv_led.h" line="70" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L70">
      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 *led, uint8_t bright)
      ```

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

      | Name     | Type                                             | Description                                                            |
      | -------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
      | `led`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a LED object                                                |
      | `bright` | <ApiLink name="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="widgets/led/lv_led.h" line="95" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L95">
      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:** <ApiLink name="uint8_t" /> — bright 0 (max. dark) ... 255 (max. light)
    </ApiMember>

    <ApiMember kind="function" name="lv_led_get_color" file="widgets/led/lv_led.h" line="102" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L102">
      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="widgets/led/lv_led.h" line="56" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L56">
      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 an object, it will be the parent of the new led |

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

    <ApiMember kind="function" name="lv_led_on" file="widgets/led/lv_led.h" line="76" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L76">
      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="widgets/led/lv_led.h" line="82" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L82">
      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="widgets/led/lv_led.h" line="88" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/lv_led.h#L88">
      lv_led_toggle [#lv_led_toggle]

      Toggle the state of a LED

      ```c title=" " lineNumbers=1
      void lv_led_toggle(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>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_led_id_t" file="widgets/led/lv_led.h" line="40" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/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="widgets/led/lv_led.h" line="25" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/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="widgets/led/lv_led.h" line="30" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/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="widgets/led/lv_led.h" line="37" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/led/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;lv_led_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.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_conf_kconfig.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_ll.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_property_names.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_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
