1.. _lv_led: 2 3============ 4LED (lv_led) 5============ 6 7Overview 8******** 9 10LEDs are rectangle-like (or circle) Widgets whose brightness can be 11adjusted. With lower brightness the color of the LED becomes darker. 12 13.. _lv_led_parts_and_styles: 14 15Parts and Styles 16**************** 17 18- :cpp:enumerator:`LV_LED_PART_MAIN` uses the :ref:`typical background style 19 properties <typical bg props>`. 20 21.. _lv_led_usage: 22 23Usage 24***** 25 26Color 27----- 28 29You set the color of the LED with 30:cpp:expr:`lv_led_set_color(led, lv_color_hex(0xff0080))`. This will be used as its 31background color, border color, and shadow color. 32 33Brightness 34---------- 35 36You can set their brightness with :cpp:expr:`lv_led_set_brightness(led, brightness)`. 37The ``brightness`` value should be in the range 0 (darkest) to 255 (lightest). 38 39Toggle 40------ 41 42Use :cpp:expr:`lv_led_on(led)` and :cpp:expr:`lv_led_off(led)` to set the brightness to 43a predefined ON or OFF value. The :cpp:expr:`lv_led_toggle(led)` toggles between 44the ON and OFF state. 45 46You can set custom LED ON and OFF brightness values by defining macros 47``LV_LED_BRIGHT_MAX`` and ``LV_LED_BRIGHT_MIN`` in your project. Their default 48values are 80 and 255. These too must be in the range [0..255]. 49 50 51 52.. _lv_led_events: 53 54Events 55****** 56 57No special events are sent by LED Widgets. 58 59.. admonition:: Further Reading 60 61 Learn more about :ref:`lv_obj_events` emitted by all Widgets. 62 63 Learn more about :ref:`events`. 64 65 66 67.. _lv_led_keys: 68 69Keys 70**** 71 72No *Keys* are processed by LED Widgets. 73 74.. admonition:: Further Reading 75 76 Learn more about :ref:`indev_keys`. 77 78 79 80.. _lv_led_example: 81 82Example 83******* 84 85.. include:: ../../examples/widgets/led/index.rst 86 87 88 89.. _lv_led_api: 90 91API 92*** 93