这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
icore4tlvgl_6 [2020/12/03 17:07] zgf |
icore4tlvgl_6 [2022/04/01 11:12] (当前版本) sean |
||
---|---|---|---|
行 2: | 行 2: | ||
|技术支持电话|**0379-69926675-801**||| | |技术支持电话|**0379-69926675-801**||| | ||
|技术支持邮件|Gingko@vip.163.com||| | |技术支持邮件|Gingko@vip.163.com||| | ||
- | |技术论坛|http://www.eeschool.org||| | ||
^ 版本 ^ 日期 ^ 作者 ^ 修改内容 ^ | ^ 版本 ^ 日期 ^ 作者 ^ 修改内容 ^ | ||
| V1.0 | 2020-11-19 | yang | 初次建立 | | | V1.0 | 2020-11-19 | yang | 初次建立 | | ||
行 22: | 行 21: | ||
void lv_gui_run(void) | void lv_gui_run(void) | ||
{ | { | ||
- | int t=0; /*定义变量t*/ | + | int t=0; /*定义变量t*/ |
- | lvgl2rtt_init("lcd"); /*初始化lvgl2rtt*/ | + | lvgl2rtt_init("lcd"); /*初始化lvgl2rtt*/ |
- | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
while(true){ | while(true){ | ||
- | lv_label_set_text_fmt(label1, "timer: %d s",t++); /*格式化显示*/ | + | lv_label_set_text_fmt(label1, "timer: %d s",t++); /*格式化显示*/ |
- | rt_thread_mdelay(1000); /*延时1ms*/ | + | rt_thread_mdelay(1000); /*延时1ms*/ |
} | } | ||
} | } | ||
行 39: | 行 38: | ||
<code c> | <code c> | ||
lvgl2rtt_init("lcd"); | lvgl2rtt_init("lcd"); | ||
- | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ lv_label_set_text(label1, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | + | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
+ | |||
+ | lv_label_set_text(label1, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | ||
</code> | </code> | ||
行 58: | 行 59: | ||
<code c> | <code c> | ||
lvgl2rtt_init("lcd"); | lvgl2rtt_init("lcd"); | ||
- | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
lv_obj_set_pos(label1, 10, 10); /*设置标签坐标*/ | lv_obj_set_pos(label1, 10, 10); /*设置标签坐标*/ | ||
- | lv_label_set_long_mode(label1, LV_LABEL_LONG_EXPAND); /*设置标签长模式*/ | + | lv_label_set_long_mode(label1, LV_LABEL_LONG_EXPAND); /*设置标签长模式*/ |
- | lv_obj_set_width(label1,240); /*设置标签宽度*/ | + | lv_obj_set_width(label1,240); /*设置标签宽度*/ |
lv_label_set_text(label1, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label1, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label2 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label2 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
lv_obj_set_pos(label2, 10, 50); /*设置标签坐标*/ | lv_obj_set_pos(label2, 10, 50); /*设置标签坐标*/ | ||
- | lv_label_set_long_mode(label2, LV_LABEL_LONG_BREAK); /*设置标签长模式*/ | + | lv_label_set_long_mode(label2, LV_LABEL_LONG_BREAK); /*设置标签长模式*/ |
lv_obj_set_width(label2, 240); /*设置标签宽度*/ | lv_obj_set_width(label2, 240); /*设置标签宽度*/ | ||
lv_label_set_text(label2, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label2, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label3 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label3 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
lv_obj_set_pos(label3, 10, 120); /*设置标签坐标*/ | lv_obj_set_pos(label3, 10, 120); /*设置标签坐标*/ | ||
- | lv_label_set_long_mode(label3, LV_LABEL_LONG_DOT); /*设置标签长模式*/ | + | lv_label_set_long_mode(label3, LV_LABEL_LONG_DOT); /*设置标签长模式*/ |
lv_obj_set_width(label3,240); /*设置标签宽度*/ | lv_obj_set_width(label3,240); /*设置标签宽度*/ | ||
lv_label_set_text(label3, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label3, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label4 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label4 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
lv_obj_set_pos(label4, 10, 160); /*设置标签坐标*/ | lv_obj_set_pos(label4, 10, 160); /*设置标签坐标*/ | ||
- | lv_label_set_long_mode(label4, LV_LABEL_LONG_SROLL); /*设置标签长模式*/ | + | lv_label_set_long_mode(label4, LV_LABEL_LONG_SROLL); /*设置标签长模式*/ |
- | lv_obj_set_width(label4,240); /*设置标签宽度*/ | + | lv_obj_set_width(label4,240); /*设置标签宽度*/ |
lv_label_set_text(label4, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label4, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label5 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label5 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
- | lv_obj_set_pos(label5, 10, 200); /*设置标签坐标*/ | + | lv_obj_set_pos(label5, 10, 200); /*设置标签坐标*/ |
- | lv_label_set_long_mode(label5, LV_LABEL_LONG_SROLL_CIRC); /*设置标签长模式*/ | + | lv_label_set_long_mode(label5, LV_LABEL_LONG_SROLL_CIRC); /*设置标签长模式*/ |
- | lv_obj_set_width(label5,240); /*设置标签宽度*/ | + | lv_obj_set_width(label5,240); /*设置标签宽度*/ |
lv_label_set_text(label5, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label5, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label6 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label6 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
lv_obj_set_pos(label6, 10, 240); /*设置标签坐标*/ | lv_obj_set_pos(label6, 10, 240); /*设置标签坐标*/ | ||
- | lv_label_set_long_mode(label6, LV_LABEL_LONG_CROP); /*设置标签长模式*/ | + | lv_label_set_long_mode(label6, LV_LABEL_LONG_CROP); /*设置标签长模式*/ |
lv_obj_set_width(label6,240); /*设置标签宽度*/ | lv_obj_set_width(label6,240); /*设置标签宽度*/ | ||
lv_label_set_text(label6, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | lv_label_set_text(label6, "hello world! this is GINGKO, iCore4T_RT-Thread_LVGL"); | ||
行 103: | 行 104: | ||
<code c> | <code c> | ||
lvgl2rtt_init("lcd"); | lvgl2rtt_init("lcd"); | ||
- | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
- | lv_obj_set_pos(label1, 10, 10); /*设置标签坐标*/ | + | lv_obj_set_pos(label1, 10, 10); /*设置标签坐标*/ |
- | lv_label_set_align(label1, LV_LABEL_ALIGN_LEFT); /*标签内容左对齐*/ | + | lv_label_set_align(label1, LV_LABEL_ALIGN_LEFT); /*标签内容左对齐*/ |
lv_label_set_text(label1, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | lv_label_set_text(label1, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label2 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label2 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
- | lv_obj_set_pos(label2, 10, 100); /*设置标签坐标*/ | + | lv_obj_set_pos(label2, 10, 100); /*设置标签坐标*/ |
- | lv_label_set_align(label2, LV_LABEL_ALIGN_RIGHT); /*标签内容右对齐*/ | + | lv_label_set_align(label2, LV_LABEL_ALIGN_RIGHT); /*标签内容右对齐*/ |
lv_label_set_text(label2, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | lv_label_set_text(label2, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | ||
- | lv_obj_t * label3 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label3 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
- | lv_obj_set_pos(label3, 10, 190); /*设置标签坐标*/ | + | lv_obj_set_pos(label3, 10, 190); /*设置标签坐标*/ |
- | lv_label_set_align(label3, LV_LABEL_ALIGN_CENTER); /*标签内容中心对齐*/ | + | lv_label_set_align(label3, LV_LABEL_ALIGN_CENTER); /*标签内容中心对齐*/ |
lv_label_set_text(label3, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | lv_label_set_text(label3, "hello world\nthis is GINGKO\niCore4T_RT-Thread_LVGL"); | ||
</code> | </code> | ||
行 128: | 行 129: | ||
<code c> | <code c> | ||
lvgl2rtt_init("lcd"); | lvgl2rtt_init("lcd"); | ||
- | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ | + | lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); /*创建一个标签在屏幕中*/ |
- | lv_label_set_recolor(label1, true); /*使能重新着色*/ | + | lv_label_set_recolor(label1, true); /*使能重新着色*/ |
- | lv_label_set_text(label1, "#ff0000 hello# world\n" /*设置hello为红色*/ | + | lv_label_set_text(label1, "#ff0000 hello# world\n" /*设置hello为红色*/ |
"#00ff00 this# is #ffff00 GINGKO#\n" | "#00ff00 this# is #ffff00 GINGKO#\n" | ||
"#0000ff iCore4T_RT-Thread_LVGL#"); | "#0000ff iCore4T_RT-Thread_LVGL#"); |