
本文来源:https://kwkr.cn/news/11408.html
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
1. 项目概述一块能“摸”的智能手表核心板最近在捣鼓一个智能穿戴的小项目需要一块既能显示丰富信息又能通过触摸进行交互的核心板。市面上很多开发板要么屏幕太小要么不带触摸要么功耗太高。直到我遇到了这块ESP32-S3-Touch-LCD-1.28它几乎是为这类应用量身定做的。简单来说这是一块集成了ESP32-S3高性能MCU、1.28英寸圆形LCD触摸屏、电池管理以及丰富外设接口的一体化核心板。你拿到手接上电池和几个传感器就能快速搭建出一个功能完整的智能手表、智能家居中控或者工业手持设备的原型。它最吸引我的地方在于“All-in-One”的设计理念。ESP32-S3提供了强大的双核处理能力和Wi-Fi/蓝牙连接1.28寸的圆形屏兼顾了显示面积和便携性而电容触摸则让交互变得直观。对于开发者尤其是嵌入式爱好者和小型产品团队来说它极大地简化了硬件设计让你能把精力集中在应用逻辑和软件创新上而不是纠结于
屏幕驱动、触摸芯片布线这些底层硬件问题上。接下来我就结合自己实际使用的经验从硬件拆解到软件上手详细聊聊这块板子的门道。2. 核心硬件深度解析与选型思考2.1 ESP32-S3主控为何是它选择ESP32-S3作为核心是这块板子高性能的基石。相较于经典的ESP32S3版本有几个关键升级点正好契合了带屏交互设备的需求。首先双核Xtensa® 32位LX7处理器主频高达240MHz。对于驱动一块分辨率在240x240左右的LCD屏并运行LVGL一个轻量级图形库来说单核MCU在界面复杂、动画较多时可能会吃力。双核架构允许我们将UI刷新、触摸事件处理放在一个核心而网络通信、传感器数据融合、业务逻辑放在另一个核心有效避免界面卡顿。我实测在运行一个带有图表、列表和动画的LVGL界面时双核的流畅度明显优于我之前用的单核MCU方案。其次更大的内存。我手上这块板子通常搭载8MB的PSRAM伪静态随机存储器和4M
B或8MB的Flash。PSRAM对于图形界面至关重要。LVGL的帧缓冲区Frame Buffer、图片解码缓存、字体缓存都需要消耗大量RAM。如果没有外部PSRAM仅靠芯片内部的几百KB SRAM几乎不可能做出复杂的UI。8MB的PSRAM为绚丽的界面提供了充足的“画布”。再者丰富的接口。ESP32-S3提供了足够的GPIO、I2C、SPI、I2S等外设。这块核心板巧妙地将大部分GPIO通过板边的邮票孔或排针引出同时预留了关键的FPC座子连接屏幕。这意味着你在使用屏幕的同时仍然有充足的引脚去连接心率传感器、加速度计、GPS模块等外部设备扩展性很强。注意ESP32-S3有多个子型号主要区别在于内置Flash和PSRAM的大小。对于图形化项目强烈建议选择带有8MB PSRAM的型号。在购买核心板或整板时一定要确认这个参数。2.2 1.28英寸圆形LCD触摸屏显示与交互的窗口这块屏幕是项目的视
觉和交互中心它的选型直接决定了用户体验的上限。屏幕本身通常是IPS材质的TFT-LCD分辨率多为240x240或240x240。圆形设计非常适合手表、圆形仪表盘等应用。IPS屏幕的优势在于可视角度大色彩表现也相对不错。240x240的分辨率在1.28英寸的尺寸下像素密度PPI大约在265左右显示图标和文字足够清晰不会有明显的颗粒感。触摸芯片通常采用GT911或FT6236这类常见的电容触摸控制器。它们通过I2C接口与主控通信。这里有一个关键细节触摸屏的驱动和校准。出厂时屏幕模组可能已经进行了基本的校准但在不同的结构件比如盖板玻璃安装下触摸坐标可能会有偏移。因此在软件中集成一个触摸校准程序通常是让用户依次点击屏幕四个角或中心点是非常必要的。我遇到过因为外壳公差导致触摸点击不准确的问题就是通过软件校准解决的。连接方式屏幕通过一个细长的FPC柔性电路板排线连接到核心板。排线上集成了LCD的RGB
/MIPI接口和触摸芯片的I2C线路。安装时一定要确保排线插到底并锁紧FPC座子的卡扣接触不良会导致花屏或触摸失灵。2.3 板载电路与电源管理设计一块好的核心板其电源设计决定了系统的稳定性和续航能力。电源路径这块板子通常支持多种供电方式USB Type-C接口供电、3.7V锂电池供电、以及外部3.3V直接供电。核心是一颗电源管理芯片PMIC比如AXP2101或类似型号。它负责将USB的5V或电池的3.7V-4.2V电压转换为系统所需的3.3V、2.5V、1.8V等各路电压。充电管理PMIC也集成了锂电池充电管理功能支持恒流/恒压充电。通过测量BAT引脚电压我们可以实时在软件中读取电池电量。这里有一个实操心得为了获得相对准确的电量百分比不能单纯用电压来换算。因为锂电池的放电曲线不是线性的。更可靠的做法是1) 在软件中实现一个简单的库结合电压和放电曲线进行估算2) 或者如果PMIC支持使用其库
仑计功能测量进出电池的电荷量这是最准确的方式。低功耗考量对于穿戴设备休眠功耗至关重要。ESP32-S3本身支持多种低功耗模式Light-sleep, Deep-sleep。在深度睡眠下只有RTC实时时钟和少量内存保持供电功耗可以低至10μA级别。这块核心板在设计时需要确保在MCU进入深度睡眠后屏幕、触摸芯片等外围电路的电源能被有效切断通常通过PMIC或一个MOS管控制否则漏电流会大大缩短待机时间。在硬件设计评审时一定要检查这部分电路。3. 软件开发环境搭建与核心驱动3.1 开发框架选择ESP-IDF vs Arduino这是上手第一步也是很多新手会纠结的地方。主要就两个选择官方的ESP-IDF框架和基于它的Arduino-ESP32。ESP-IDF这是乐鑫官方的物联网开发框架基于FreeRTOS提供最底层、最全面的API和控制能力。如果你追求极致的性能控制、深度定制或者项目比较复杂需要精细
管理内存和任务ESP-IDF是首选。它的学习曲线稍陡但资料最权威。Arduino-ESP32这是一个在ESP-IDF之上封装的Arduino核心库。它简化了大量操作有海量的第三方库很多传感器驱动在Arduino社区都能找到上手速度极快。对于快速原型验证、爱好者项目、或者对实时性要求不是极端苛刻的应用Arduino是非常好的选择。我的建议对于ESP32-S3-Touch-LCD-1.28这类带屏项目我强烈推荐从ESP-IDF开始。原因如下LVGL集成目前LVGL与ESP-IDF的集成度最高乐鑫官方提供了esp_lvgl_port等组件可以非常方便地将LVGL作为组件Component添加到你的项目中并处理好与ESP32显示驱动如esp_lcd的衔接。驱动支持屏幕如ST7789、GC9A01驱动芯片和触摸芯片GT911的驱动在ESP-IDF的组件仓库或乐鑫的Github示例中都能找到成熟、高效
的实现。双核利用在ESP-IDF中你可以更直观地创建FreeRTOS任务并指定运行在哪个核心上便于实现UI与逻辑的分离。当然如果你对Arduino非常熟悉也可以使用。现在Arduino-ESP32也支持了LVGL和很多屏幕驱动库只是可能在底层优化和最新特性跟进上稍慢半拍。3.2 显示与触摸驱动移植这是让屏幕亮起来和能触摸的关键步骤。在ESP-IDF环境下通常遵循以下流程1. 添加显示驱动组件通常不需要从零写驱动。乐鑫的esp-idf组件仓库在IDF的组件管理器里或者Github上如lvgl/lv_port_esp32有大量现成驱动。以常见的ST7789驱动芯片为例你可能会找到一个名为esp_lcd的组件或独立的st7789驱动组件。将其添加到你的项目components文件夹或者通过idf.py add-dependency命令添加。2. 初始化序列配置驱动库的核心是一个初始化命令序列。这
个序列告诉屏幕如何设置如颜色格式、扫描方向、亮度等。这个序列通常由屏幕模组厂商提供也可以在驱动库的示例中找到。关键点在于调整offset_x和offset_y。因为圆形屏幕的显示区域在方形驱动芯片缓冲区中是居中的你需要设置这两个偏移量以确保图像显示在屏幕正中央而不是角落。// 示例ST7789初始化配置片段 esp_lcd_panel_handle_t panel_handle NULL; esp_lcd_rgb_panel_config_t panel_config { .clk_src LCD_CLK_SRC_PLL160M, .timings { .pclk_hz 10 * 1000 * 1000, // 像素时钟影响刷新率 .h_res 240, .v_res 240, // ... 其他时序参数通常驱动库提供默认值 }, .data_width 16, // RG
B565格式 .psram_trans_align 64, .hsync_gpio_num HSYNC_GPIO, .vsync_gpio_num VSYNC_GPIO, .de_gpio_num DE_GPIO, .pclk_gpio_num PCLK_GPIO, .data_gpio_nums {DATA0_GPIO, DATA1_GPIO, ...}, // 16位数据线 .disp_gpio_num DISP_GPIO, // 屏幕使能引脚 .on_frame_trans_done NULL, .user_ctx NULL, .flags { .fb_in_psram 1, // 关键帧缓冲区放在PSRAM }, }; ESP_ERROR_CHECK(esp_lcd_new_rgb_panel(panel_config, panel_handle)); ESP
_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle)); // 设置偏移使图像居中 ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, offset_x, offset_y));3. 集成LVGL通过ESP-IDF的组件管理器安装LVGL。安装后在你的项目CMakeLists.txt中声明依赖并在main.c中初始化LVGL并将其绑定到刚才初始化的显示驱动和触摸驱动上。esp_lvgl_port这个组件可以帮助你完成大部分绑定工作。4. 触摸驱动初始化触摸芯片如GT911通过I2C通信。首先初始化I2C总线然后加载触摸驱动。驱动会提供一个读取触摸点坐标的函数。你需要将这个函数注册到LVGL的输入设备
接口中。// 示例GT911触摸初始化简化 i2c_config_t conf { .mode I2C_MODE_MASTER, .sda_io_num TOUCH_SDA_GPIO, .scl_io_num TOUCH_SCL_GPIO, .sda_pullup_en GPIO_PULLUP_ENABLE, .scl_pullup_en GPIO_PULLUP_ENABLE, .master.clk_speed 400000, // 400kHz }; i2c_param_config(I2C_NUM_0, conf); i2c_driver_install(I2C_NUM_0, conf.mode, 0, 0, 0); // 初始化GT911获取触摸点函数 gt911_read_points // ... // 向LVGL注册触摸输入设备 static lv_indev_
drv_t indev_drv; lv_indev_drv_init(indev_drv); indev_drv.type LV_INDEV_TYPE_POINTER; indev_drv.read_cb gt911_read_points; // 你的触摸读取函数 lv_indev_t * touch_indev lv_indev_drv_register(indev_drv);3.3 图形界面开发与LVGL基础LVGL是一个功能强大的嵌入式图形库学习它是在这块板子上做项目的核心。核心概念对象Objects按钮、标签、滑块、图表等都是对象。你可以设置它们的大小、位置、样式、事件回调函数。样式Styles定义对象的外观如颜色、字体、边框、阴影等。样式可以复用大大节省内存。事件Events例如LV_EVENT_CLICKED、LV_EVENT_VALUE_CHANGED。你可以为对象绑
定事件处理函数实现交互逻辑。屏幕ScreensLVGL管理多个屏幕你可以通过lv_scr_load(screen1)来切换。快速上手一个简单界面假设我们要创建一个带有一个按钮和文本标签的界面。// 创建主屏幕 lv_obj_t * scr lv_scr_act(); // 创建一个按钮 lv_obj_t * btn lv_btn_create(scr); lv_obj_set_size(btn, 100, 50); // 宽100像素高50像素 lv_obj_align(btn, LV_ALIGN_CENTER, 0, -30); // 居中向上偏移30像素 // 为按钮添加标签 lv_obj_t * label lv_label_create(btn); lv_label_set_text(label, Click Me!); lv_obj_center(label); // 创建
一个标签用于显示信息 lv_obj_t * info_label lv_label_create(scr); lv_label_set_text(info_label, Ready.); lv_obj_align_to(info_label, btn, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); // 在按钮下方 // 为按钮添加点击事件 static void btn_event_handler(lv_event_t * e) { lv_event_code_t code lv_event_get_code(e); if(code LV_EVENT_CLICKED) { lv_label_set_text(info_label, Button Clicked!); } } lv_obj_add_event_cb(btn, btn_event_handler,

本文来源:https://kwkr.cn/news/11408.html
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
1. Project overview: a smartwatch core board you can "touch." Recently I've been tinkering with a small smart-wearable project that needs a core board capable of both displaying rich information and interacting via touch. Many development boards on the market either have screens that are too small, lack touch, or consume too much power. That was until I came across the ESP32-S3-Touch-LCD-1.28, which seems almost tailor-made for this kind of application. In short, it's an all-in-one core board integrating a high-performance ESP32-S3 MCU, a 1.28-inch circular LCD touchscreen, battery management, and a rich set of peripheral interfaces. Once you get your hands on it, connect a battery and a few sensors, and you can quickly build a fully functional prototype of a smartwatch, a smart-home control hub, or an industrial handheld device. What attracts me most is its "All-in-One" design philosophy. The ESP32-S3 provides powerful dual-core processing and Wi-Fi/Bluetooth connectivity, the 1.28-inch circular screen balances display area with portability, and capacitive touch makes interaction intuitive. For developers—especially embedded enthusiasts and small product teams—it greatly simplifies hardware design, letting you focus your energy on application logic and software innovation rather than getting bogged down in
low-level hardware issues like screen driving and touch-controller routing. Next, drawing on my own hands-on experience, I'll go into the details of this board from hardware teardown to software getting-started. 2. In-depth analysis of core hardware and selection rationale. 2.1 Why the ESP32-S3 as the main controller. Choosing the ESP32-S3 as the core is the foundation of this board's high performance. Compared with the classic ESP32, the S3 version has several key upgrades that perfectly match the needs of screen-equipped interactive devices. First, a dual-core Xtensa® 32-bit LX7 processor clocked up to 240MHz. For driving an LCD screen at around 240x240 resolution and running LVGL—a lightweight graphics library—a single-core MCU may struggle when the interface is complex and animations are frequent. The dual-core architecture lets us put UI refresh and touch-event handling on one core, and network communication, sensor data fusion, and business logic on the other, effectively avoiding UI stutter. In my tests, when running an LVGL interface with charts, lists, and animations, the dual-core smoothness was clearly better than the single-core MCU solution I'd used before. Second, larger memory. The board I have usually carries 8MB of PSRAM (pseudo-static random access memory) and 4M
B or 8MB of Flash. PSRAM is crucial for graphical interfaces. LVGL's frame buffer, image-decoding cache, and font cache all consume large amounts of RAM. Without external PSRAM, relying only on the chip's few hundred KB of internal SRAM, it's nearly impossible to build a complex UI. The 8MB of PSRAM provides ample "canvas" for dazzling interfaces. Third, rich interfaces. The ESP32-S3 provides plenty of GPIO, I2C, SPI, I2S, and other peripherals. This core board cleverly routes most GPIOs out through castellated holes or pin headers along the board edges, while reserving a key FPC connector for the screen. This means that while using the screen you still have plenty of pins to connect external devices such as heart-rate sensors, accelerometers, and GPS modules—strong expandability. Note that the ESP32-S3 has several sub-models, mainly differing in the size of built-in Flash and PSRAM. For graphical projects, it's strongly recommended to choose a model with 8MB of PSRAM. When buying the core board or a full board, be sure to confirm this parameter. 2.2 The 1.28-inch circular LCD touchscreen: the window for display and interaction. This screen is the visual centerpiece of the project, and its selection directly determines the ceiling of the user experience. The screen
itself is usually a TFT-LCD with IPS material, and its resolution is mostly 240x240 or 240x240. The circular design is very suitable for watches, round instrument panels, and similar applications. IPS screens have the advantage of wide viewing angles and relatively good color reproduction. A resolution of 240x240 at a size of 1.28 inches gives a pixel density (PPI) of about 265, enough to display icons and text clearly without obvious graininess. The touch controller is usually a common capacitive touch controller such as the GT911 or FT6236. They communicate with the main controller over the I2C interface. There's a key detail here: touchscreen driving and calibration. At the factory the screen module may have undergone basic calibration, but under different structural components—for example, with a cover glass installed—the touch coordinates may shift. Therefore, integrating a touch-calibration routine in the software—typically having the user tap the four corners or center of the screen in sequence—is very necessary. I've encountered a problem where enclosure tolerances caused inaccurate touch taps, and it was resolved through software calibration. As for the connection method, the screen connects to the core board via a slim FPC (flexible printed circuit) ribbon cable. The ribbon integrates the LCD's RGB
/MIPI interface and the I2C lines for the touch controller. During installation, be sure to insert the ribbon all the way in and lock the FPC connector's latch; poor contact will cause a distorted display or touch failure. 2.3 Onboard circuitry and power management design. For a good core board, its power design determines system stability and battery life. Power path: this board typically supports multiple power-supply options—USB Type-C, a 3.7V lithium battery, and direct external 3.3V supply. At the core is a power management IC (PMIC), such as the AXP2101 or a similar model. It converts the USB 5V or the battery's 3.7V–4.2V into the various voltages the system needs, such as 3.3V, 2.5V, and 1.8V. Charge management: the PMIC also integrates lithium-battery charge management, supporting constant-current/constant-voltage (CC/CV) charging. By measuring the BAT pin voltage, we can read the battery level in software in real time. Here's a practical tip: to obtain a relatively accurate battery percentage, you can't simply convert from voltage, because a lithium battery's discharge curve is not linear. More reliable approaches are: 1) implement a simple model/library in software that estimates the level by combining voltage with the discharge curve, or 2) if the PMIC supports it, use its coulomb
counter (fuel gauge) function to measure the charge flowing in and out of the battery—this is the most accurate method. Low-power considerations: sleep power consumption is critical for wearable devices. The ESP32-S3 itself supports multiple low-power modes—Light-sleep and Deep-sleep. In deep sleep, only the RTC (real-time clock) and a small amount of memory remain powered, and current consumption can drop to the 10μA level. When designing this core board, you need to ensure that after the MCU enters deep sleep, the power to peripheral circuits such as the screen and touch controller can be effectively cut off—usually controlled through the PMIC or a MOSFET—otherwise leakage current will greatly shorten standby time. During hardware design review, be sure to check this part of the circuit. 3. Software development environment setup and core drivers. 3.1 Development framework choice: ESP-IDF vs. Arduino. This is the first step in getting started and a place where many beginners hesitate. There are mainly two choices: the official ESP-IDF framework and Arduino-ESP32 built on top of it. ESP-IDF: This is Espressif's official IoT development framework, based on FreeRTOS, providing the lowest-level and most comprehensive APIs and control capabilities. If you're pursuing ultimate performance control, deep customization, or have a relatively complex project that needs fine-grained
memory and task management, ESP-IDF is the first choice. Its learning curve is a bit steeper, but its documentation is the most authoritative. Arduino-ESP32: This is an Arduino core library wrapped on top of ESP-IDF. It simplifies a great many operations and has a vast number of third-party libraries; many sensor drivers can be found in the Arduino community, making it extremely fast to get started. For rapid prototyping, hobbyist projects, or applications without extremely strict real-time requirements, Arduino is an excellent choice. My recommendation: for screen-equipped projects like the ESP32-S3-Touch-LCD-1.28, I strongly recommend starting with ESP-IDF. The reasons are as follows. LVGL integration: currently LVGL has the highest level of integration with ESP-IDF; Espressif officially provides components such as esp_lvgl_port, which make it very convenient to add LVGL as a Component to your project and handle the interface with ESP32 display drivers such as esp_lcd. Driver support: drivers for screen controller chips such as ST7789 and GC9A01, and for the touch controller GT911, can be found in ESP-IDF's component registry or in Espressif's GitHub examples—mature, efficient
implementations. Dual-core utilization: in ESP-IDF you can more intuitively create FreeRTOS tasks and specify which core they run on, making it easier to separate UI from logic. Of course, if you're very familiar with Arduino, you can use that too. Nowadays Arduino-ESP32 also supports LVGL and many screen-driver libraries, though it may lag slightly in low-level optimization and keeping up with the latest features. 3.2 Porting the display and touch drivers. This is the key step to making the screen light up and respond to touch. In the ESP-IDF environment, the following flow is usually followed. 1. Add the display driver component—normally you don't need to write a driver from scratch. Espressif's esp-idf component registry, the IDF Component Manager, or GitHub (e.g., lvgl/lv_port_esp32) have plenty of ready-made drivers. Taking the common ST7789 controller chip as an example, you might find a component named esp_lcd or a standalone st7789 driver component. Add it to your project's components folder, or add it via the idf.py add-dependency command. 2. Initialization sequence configuration. The core of a driver library is an initialization command sequence. This
sequence tells the screen how to configure things such as color format, scan direction, brightness, and so on. This sequence is usually provided by the screen module vendor, but can also be found in the driver library's examples. The key point is adjusting offset_x and offset_y. Because the display area of a circular screen is centered within the square buffer of the controller chip, you need to set these two offsets to ensure the image appears in the exact center of the screen rather than in a corner. // Example ST7789 initialization configuration snippet: esp_lcd_panel_handle_t panel_handle NULL; esp_lcd_rgb_panel_config_t panel_config { .clk_src LCD_CLK_SRC_PLL160M, .timings { .pclk_hz 10 * 1000 * 1000, // pixel clock affects refresh rate .h_res 240, .v_res 240, // ... other timing parameters, driver library usually provides defaults }, .data_width 16, // RG
B565 format .psram_trans_align 64, .hsync_gpio_num HSYNC_GPIO, .vsync_gpio_num VSYNC_GPIO, .de_gpio_num DE_GPIO, .pclk_gpio_num PCLK_GPIO, .data_gpio_nums {DATA0_GPIO, DATA1_GPIO, ...}, // 16-bit data lines .disp_gpio_num DISP_GPIO, // screen enable pin .on_frame_trans_done NULL, .user_ctx NULL, .flags { .fb_in_psram 1, // key: frame buffer placed in PSRAM }, }; ESP_ERROR_CHECK(esp_lcd_new_rgb_panel(panel_config, panel_handle)); ESP
_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle)); // set offset to center the image ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, offset_x, offset_y)); 3. Integrate LVGL. Install LVGL through the ESP-IDF Component Manager. After installation, declare the dependency in your project's CMakeLists.txt and initialize LVGL in main.c, binding it to the display driver and touch driver you just initialized. The esp_lvgl_port component can help you with most of the binding work. 4. Touch driver initialization. The touch controller, e.g., the GT911, communicates over I2C. First initialize the I2C bus, then load the touch driver. The driver provides a function for reading touch-point coordinates. You need to register this function with LVGL's input device
interface. // Example GT911 touch initialization, simplified: i2c_config_t conf { .mode I2C_MODE_MASTER, .sda_io_num TOUCH_SDA_GPIO, .scl_io_num TOUCH_SCL_GPIO, .sda_pullup_en GPIO_PULLUP_ENABLE, .scl_pullup_en GPIO_PULLUP_ENABLE, .master.clk_speed 400000, // 400kHz }; i2c_param_config(I2C_NUM_0, conf); i2c_driver_install(I2C_NUM_0, conf.mode, 0, 0, 0); // initialize the GT911; touch-point reading function: gt911_read_points // ... // register the touch input device with LVGL: static lv_indev_
drv_t indev_drv; lv_indev_drv_init(indev_drv); indev_drv.type LV_INDEV_TYPE_POINTER; indev_drv.read_cb gt911_read_points; // your touch-reading function lv_indev_t * touch_indev lv_indev_drv_register(indev_drv); 3.3 Graphical interface development and LVGL basics. LVGL is a powerful embedded graphics library; learning it is the core of working on projects with this board. Core concepts. Objects: buttons, labels, sliders, charts, and so on are all objects. You can set their size, position, style, and event callback functions. Styles define the appearance of objects, such as color, font, border, shadow, etc. Styles can be reused, greatly saving memory. Events, e.g., LV_EVENT_CLICKED, LV_EVENT_VALUE_CHANGED. You can bind an event handler function to an object
to implement interaction logic. Screens: LVGL manages multiple screens, and you can switch between them with lv_scr_load(screen1). Quick start with a simple interface: suppose we want to create an interface with a button and a text label. // Create the main screen lv_obj_t * scr lv_scr_act(); // create a button lv_obj_t * btn lv_btn_create(scr); lv_obj_set_size(btn, 100, 50); // 100 pixels wide, 50 pixels tall lv_obj_align(btn, LV_ALIGN_CENTER, 0, -30); // centered, offset 30 pixels up // add a label to the button lv_obj_t * label lv_label_create(btn); lv_label_set_text(label, Click Me!); lv_obj_center(label); // create
a label for displaying information lv_obj_t * info_label lv_label_create(scr); lv_label_set_text(info_label, Ready.); lv_obj_align_to(info_label, btn, LV_ALIGN_OUT_BOTTOM_MID, 0, 20); // below the button // add a click event to the button static void btn_event_handler(lv_event_t * e) { lv_event_code_t code lv_event_get_code(e); if(code LV_EVENT_CLICKED) { lv_label_set_text(info_label, Button Clicked!); } } lv_obj_add_event_cb(btn, btn_event_handler,