lvgl demo
This commit is contained in:
+1
-1
Submodule components/blk_box_lib updated: d5a7aa1891...59d038efc2
@@ -1,4 +1,12 @@
|
||||
dependencies:
|
||||
atanisoft/esp_lcd_ili9488:
|
||||
dependencies:
|
||||
- name: idf
|
||||
version: '>=4.4.2'
|
||||
source:
|
||||
path: ..\esp_lcd_ili9488
|
||||
type: local
|
||||
version: 1.1.0
|
||||
espressif/led_strip:
|
||||
component_hash: 28621486f77229aaf81c71f5e15d6fbf36c2949cf11094e07090593e659e7639
|
||||
dependencies:
|
||||
@@ -14,6 +22,7 @@ dependencies:
|
||||
type: idf
|
||||
version: 6.0.1
|
||||
direct_dependencies:
|
||||
- atanisoft/esp_lcd_ili9488
|
||||
- espressif/led_strip
|
||||
- idf
|
||||
manifest_hash: 104ee01597639c0b6c90ebbe71e61d9642bbc422f80747aa239202863e58174a
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "blk_box_drivers/char_lcd.hpp"
|
||||
#include "blk_box_drivers/ssegs.hpp"
|
||||
#include "blk_box_drivers/helpers.hpp"
|
||||
#include "blk_box_drivers/tft.hpp"
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
#include "esp_log.h"
|
||||
@@ -127,6 +129,45 @@ extern "C" void app_main(void) {
|
||||
|
||||
lcd_do_splash();
|
||||
|
||||
lvgl_lock(portMAX_DELAY);
|
||||
|
||||
// Get the default screen
|
||||
lv_obj_t * scr = lv_scr_act();
|
||||
|
||||
// Create a title label
|
||||
lv_obj_t * title = lv_label_create(scr);
|
||||
lv_label_set_text(title, "Display Test");
|
||||
lv_obj_align(title, LV_ALIGN_TOP_MID, 0, 10);
|
||||
lv_obj_set_style_text_font(title, &lv_font_montserrat_24, 0);
|
||||
|
||||
// Create a status label
|
||||
lv_obj_t * status = lv_label_create(scr);
|
||||
lv_label_set_text(status, "Testing display...");
|
||||
lv_obj_align(status, LV_ALIGN_CENTER, 0, -20);
|
||||
|
||||
// Create a progress bar
|
||||
lv_obj_t * bar = lv_bar_create(scr);
|
||||
lv_obj_set_size(bar, 200, 20);
|
||||
lv_obj_align(bar, LV_ALIGN_CENTER, 0, 30);
|
||||
lv_bar_set_value(bar, 50, LV_ANIM_OFF);
|
||||
|
||||
// Create a button with callback
|
||||
lv_obj_t * btn = lv_btn_create(scr);
|
||||
lv_obj_set_size(btn, 100, 40);
|
||||
lv_obj_align(btn, LV_ALIGN_BOTTOM_MID, 0, -20);
|
||||
|
||||
lv_obj_t * btn_label = lv_label_create(btn);
|
||||
lv_label_set_text(btn_label, "Test");
|
||||
lv_obj_center(btn_label);
|
||||
|
||||
// Create a color test area
|
||||
lv_obj_t * color_test = lv_obj_create(scr);
|
||||
lv_obj_set_size(color_test, 80, 60);
|
||||
lv_obj_align(color_test, LV_ALIGN_BOTTOM_LEFT, 10, -20);
|
||||
lv_obj_set_style_bg_color(color_test, lv_color_hex(0xFF0000), 0); // Red
|
||||
|
||||
lvgl_unlock();
|
||||
|
||||
LCDController::set_resting_cursor_mode(CursorMode::Show);
|
||||
LCDController::set_resting_cursor_pos(0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user