blob: bb011a9a5405c7e0d7756987a82b38a5d82a0187 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
.. _lv_led:
============
LED (lv_led)
============
Overview
********
The LEDs are rectangle-like (or circle) object whose brightness can be
adjusted. With lower brightness the colors of the LED become darker.
.. _lv_led_parts_and_styles:
Parts and Styles
****************
- :cpp:enumerator:`LV_LED_PART_MAIN` uses all the typical background style properties.
.. _lv_led_usage:
Usage
*****
Color
-----
You can set the color of the LED with
:cpp:expr:`lv_led_set_color(led, lv_color_hex(0xff0080))`. This will be used as
background color, border color, and shadow color.
Brightness
----------
You can set their brightness with :cpp:expr:`lv_led_set_bright(led, bright)`.
The brightness should be between 0 (darkest) and 255 (lightest).
Toggle
------
Use :cpp:expr:`lv_led_on(led)` and :cpp:expr:`lv_led_off(led)` to set the brightness to
a predefined ON or OFF value. The :cpp:expr:`lv_led_toggle(led)` toggles between
the ON and OFF state.
.. _lv_led_events:
Events
******
See the events of the :ref:`Base object <lv_obj>` too.
Learn more about :ref:`events`.
.. _lv_led_keys:
Keys
****
No *Keys* are processed by the object type.
Learn more about :ref:`indev_keys`.
.. _lv_led_example:
Example
*******
.. include:: ../examples/widgets/led/index.rst
.. _lv_led_api:
API
***
|