diff --git a/components/blk_box_lib b/components/blk_box_lib index d5a7aa1..59d038e 160000 --- a/components/blk_box_lib +++ b/components/blk_box_lib @@ -1 +1 @@ -Subproject commit d5a7aa1891f09abd19b74225f0bce95d231435da +Subproject commit 59d038efc2c78a98aec32bf5da38b77f3ca13313 diff --git a/dependencies.lock b/dependencies.lock index 75f0826..822dde8 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -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 diff --git a/main/main.cpp b/main/main.cpp index 2279cd7..b5261d4 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -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 #include "esp_log.h" @@ -126,6 +128,45 @@ extern "C" void app_main(void) { LCDController::set_backlight(true); 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);