mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-21 06:53:01 +08:00
23 lines
617 B
C
23 lines
617 B
C
#include "../../../lvgl.h"
|
|
#if LV_USE_LED
|
|
|
|
void lv_example_led_1(void)
|
|
{
|
|
/*Create a LED and switch it OFF*/
|
|
lv_obj_t * led1 = lv_led_create(lv_scr_act());
|
|
lv_obj_align(led1, NULL, LV_ALIGN_CENTER, -80, 0);
|
|
lv_led_off(led1);
|
|
|
|
/*Copy the previous LED and set a brightness*/
|
|
lv_obj_t * led2 = lv_led_create(lv_scr_act());
|
|
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
|
|
lv_led_set_bright(led2, 150);
|
|
|
|
/*Copy the previous LED and switch it ON*/
|
|
lv_obj_t * led3 = lv_led_create(lv_scr_act());
|
|
lv_obj_align(led3, NULL, LV_ALIGN_CENTER, 80, 0);
|
|
lv_led_on(led3);
|
|
}
|
|
|
|
#endif
|