acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
led.md (1572B)
1 ```eval_rst 2 .. include:: /header.rst 3 :github_url: |github_link_base|/widgets/extra/led.md 4 ``` 5 # LED (lv_led) 6 7 ## Overview 8 9 The LEDs are rectangle-like (or circle) object whose brightness can be adjusted. With lower brightness the colors of the LED become darker. 10 11 ## Parts and Styles 12 The LEDs have only one main part, called `LV_LED_PART_MAIN` and it uses all the typical background style properties. 13 14 ## Usage 15 16 ### Color 17 You can set the color of the LED with `lv_led_set_color(led, lv_color_hex(0xff0080))`. 18 This will be used as background color, border color, and shadow color. 19 20 ### Brightness 21 You can set their brightness with `lv_led_set_bright(led, bright)`. The brightness should be between 0 (darkest) and 255 (lightest). 22 23 ### Toggle 24 Use `lv_led_on(led)` and `lv_led_off(led)` to set the brightness to a predefined ON or OFF value. The `lv_led_toggle(led)` toggles between the ON and OFF state. 25 26 ## Events 27 - `LV_EVENT_DRAW_PART_BEGIN` and `LV_EVENT_DRAW_PART_END` is sent for the following types: 28 - `LV_LED_DRAW_PART_RECTANGLE` The main rectangle. `LV_OBJ_DRAW_PART_RECTANGLE` is not sent by the base object. 29 - `part`: `LV_PART_MAIN` 30 - `rect_dsc` 31 - `draw_area`: the area of the rectangle 32 33 34 See the events of the [Base object](/widgets/obj) too. 35 36 Learn more about [Events](/overview/event). 37 38 ## Keys 39 No *Keys* are processed by the object type. 40 41 Learn more about [Keys](/overview/indev). 42 43 ## Example 44 45 ```eval_rst 46 47 .. include:: ../../../examples/widgets/led/index.rst 48 49 ``` 50 51 ## API 52 53 ```eval_rst 54 55 .. doxygenfile:: lv_led.h 56 :project: lvgl 57 58 ```