App:Library:LVGL:docs:Widgets:LED (lv led)

提供: robot-jp wiki
ナビゲーションに移動検索に移動

https://docs.lvgl.io/8.2/widgets/extra/led.html

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の色は暗くなります。
戻る : Previous


Parts and Styles

英文 自動翻訳

The LEDs have only one main part, called LV_LED_PART_MAIN and it uses all the typical background style properties.

LEDはLV_LED_PART_MAINと呼ばれる1つのメインパーツのみを持ち、典型的な背景スタイルのプロパティをすべて使用します。
戻る : Previous


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の色を設定することができます。これは、背景色、ボーダー色、影の色として使用されます。
戻る : Previous


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(最も明るい)の間でなければなりません。
戻る : Previous


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の値にします。lv_led_toggle(led)は、ONとOFFの状態を切り替えます。
戻る : Previous


Events

英文 自動翻訳
  • LV_EVENT_DRAW_PART_BEGIN and LV_EVENT_DRAW_PART_END is sent for the following types:
    • LV_LED_DRAW_PART_RECTANGLE The main rectangle. LV_OBJ_DRAW_PART_RECTANGLE is not sent by the base object.
      • part: LV_PART_MAIN
      • rect_dsc
      • draw_area: the area of the rectangle


See the events of the Base object too.

Learn more about Events.

  • LV_EVENT_DRAW_PART_BEGINLV_EVENT_DRAW_PART_END 以下のタイプで送信されます。
    • LV_LED_DRAW_PART_RECTANGLE メインの矩形。LV_OBJ_DRAW_PART_RECTANGLE ベースオブジェクトからは送信されません。
      • part: LV_PART_MAIN
      • rect_dsc
      • draw_area: 矩形の領域。


Baseオブジェクトのイベントも参照してください。

イベントの詳細を確認してください。

戻る : Previous


Keys

英文 自動翻訳

No Keys are processed by the object type.

Learn more about Keys.

オブジェクトタイプによって処理されるキーはありません。

キーの詳細を確認してください。

戻る : Previous


Example

英文 自動翻訳

LED with custom style

LVGL docs example 085.png

戻る : Previous


API

英文 自動翻訳

Enums

enum lv_led_draw_part_type_t

type field in lv_obj_draw_part_dsc_t if class_p = lv_led_class Used in LV_EVENT_DRAW_PART_BEGIN and LV_EVENT_DRAW_PART_END Values:
enumerator LV_LED_DRAW_PART_RECTANGLE
The main rectangle

Functions

lv_obj_t *lv_led_create(lv_obj_t *parent)

Create a led object
Parameters
parent -- pointer to an object, it will be the parent of the new led
Returns
pointer to the created led

void lv_led_set_color(lv_obj_t *led, lv_color_t color)

Set the color of the LED
Parameters
  • led -- pointer to a LED object
  • color -- the color of the LED

void lv_led_set_brightness(lv_obj_t *led, uint8_t bright)

Set the brightness of a LED object
Parameters
  • led -- pointer to a LED object
  • bright -- LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light)

void lv_led_on(lv_obj_t *led)

Light on a LED
Parameters
led -- pointer to a LED object

void lv_led_off(lv_obj_t *led)

Light off a LED
Parameters
led -- pointer to a LED object

void lv_led_toggle(lv_obj_t *led)

Toggle the state of a LED
Parameters
led -- pointer to a LED object

uint8_t lv_led_get_brightness(const lv_obj_t *obj)

Get the brightness of a LEd object
Parameters
led -- pointer to LED object
Returns
bright 0 (max. dark) ... 255 (max. light)

Variables

const lv_obj_class_t lv_led_class

struct lv_led_t

Public Members
lv_obj_t obj
lv_color_t color
uint8_t bright
Current brightness of the LED (0..255)
Enums

enum lv_led_draw_part_type_t

in lv_obj_draw_part_dsc_ttype フィールドclass_p = lv_led_classLV_EVENT_DRAW_PART_BEGINLV_EVENT_DRAW_PART_ENDで使用される値。
enumerator LV_LED_DRAW_PART_RECTANGLE
メインの長方形

Functions

lv_obj_t *lv_led_create(lv_obj_t *parent)

ledオブジェクトの作成
Parameters
parent -- へのポインタがあれば、それが新しい led の親となります。
Returns
作成されたledへのポインタ

void lv_led_set_color(lv_obj_t *led, lv_color_t color)

LEDの色を設定する
Parameters
  • led -- LEDオブジェクトへのポインタ
  • color -- LEDの色

void lv_led_set_brightness(lv_obj_t *led, uint8_t bright)

LEDオブジェクトの輝度を設定する
Parameters
  • led -- LEDオブジェクトへのポインタ
  • bright -- LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light)

void lv_led_on(lv_obj_t *led)

LEDの光
Parameters
led -- LEDオブジェクトへのポインタ

void lv_led_off(lv_obj_t *led)

LEDを点灯させる
Parameters
led -- LEDオブジェクトへのポインタ

void lv_led_toggle(lv_obj_t *led)

LEDの状態をトグルする
Parameters
led -- LEDオブジェクトへのポインタ

uint8_t lv_led_get_brightness(const lv_obj_t *obj)

LEDオブジェクトの輝度を取得する
Parameters
led -- LEDオブジェクトへのポインタ
Returns
明るさ 0 (max. dark) ... 255 (max. light)

Variables

const lv_obj_class_t lv_led_class

struct lv_led_t

Public Members
lv_obj_t obj
lv_color_t color
uint8_t bright
Current brightness of the LED (0..255)


戻る : Previous