mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
lcd: lvgl porting example
This commit is contained in:
19
examples/peripherals/lcd/lvgl/main/lvgl_demo_ui.c
Normal file
19
examples/peripherals/lcd/lvgl/main/lvgl_demo_ui.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/* LCD LVGL UI example
|
||||
|
||||
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||
|
||||
Unless required by applicable law or agreed to in writing, this
|
||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
#include "lvgl.h"
|
||||
|
||||
void example_lvgl_demo_ui(lv_obj_t *scr)
|
||||
{
|
||||
// Create a Label on the currently active screen
|
||||
lv_obj_t *label = lv_label_create(scr);
|
||||
// Modify the Label's text
|
||||
lv_label_set_text(label, "Hello World");
|
||||
// Align the Label to the center
|
||||
lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 0);
|
||||
}
|
Reference in New Issue
Block a user