[English]

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.


LED(指示灯)是矩形(或圆形)对象。它的亮度可以调节。亮度降低时,LED的颜色会变暗。

Parts and Styles(部分和样式)

显示原文
  • LV_LED_PART_MAIN uses all the typical background style properties.


  • LV_LED_PART_MAIN 它使用所有典型的背景样式属性。

Usage(用法)

Color(颜色)

显示原文

You can set the color of the LED with lv_led_set_color(led, lv_color_hex(0xff0080)). This will be used as background color, border color, and shadow color.


可以使用函数 lv_led_set_color(led, lv_color_hex(0xff0080)) 设置 LED 的颜色。这将用作背景颜色、边框颜色和阴影颜色。

Brightness(亮度)

显示原文

You can set their brightness with lv_led_set_bright(led, bright). The brightness should be between 0 (darkest) and 255 (lightest).


可以使用函数 lv_led_set_bright(led, bright) 设置它们的亮度。亮度范围:0(最暗)- 255(最亮)。

Toggle(切换)

显示原文

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.


使用函数 lv_led_on(led)lv_led_off(led) 将亮度设置为预定义的ON或OFF值。函数:cpp:expr:lv_led_toggle(led) 就像开关,会让led在ON和OFF状态之间切换。

Events(事件)

显示原文

See the events of the Base object too.

Learn more about Events(事件).


另请参阅 基础对象 的事件。

了解有关 Events(事件) 的更多内容。

Keys(按键)

显示原文

No Keys are processed by the object type.

Learn more about Keys(按键).


对象类型不处理任何 按键

了解有关 Keys(按键) 的更多内容。

Example

API

lv_types.h

lv_led.h