当前位置:网站首页>Esp32 development -lvgl animation display
Esp32 development -lvgl animation display
2022-06-11 04:07:00 【z_ Curtain】
LVGL Animation
LVGL Support dynamic effects , Including dynamic switching screen , Component animation effects, etc .
Animation creation steps and API explain
In the official demo As an example of animation creation in
// Define animation variables
lv_anim_t a;
// Initialize animation variables
lv_anim_init(&a);
// Set the components to be animated
lv_anim_set_var(&a, gauge);
// Animating features
lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)gauge_anim);
// Set the start and end values of the animation
lv_anim_set_values(&a, 0, 100);
// Set the duration of the animation
lv_anim_set_time(&a, 4000);
// Set the animation playback time
lv_anim_set_playback_time(&a, 1000);
// Number of animation repetitions
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE);
// Start the animation effect
lv_anim_start(&a);
Animation function lv_anim_set_exec_cb()
In routine , This function is equivalent to registering an animation callback function , Values and components during animation execution can be passed to the callback function as parameters ,gauge_anim It's the function name .
static void gauge_anim(lv_obj_t * gauge, lv_anim_value_t value)
{
lv_gauge_set_value(gauge, 0, value);
static char buf[64];
lv_snprintf(buf, sizeof(buf), "%d", value);
lv_obj_t * label = lv_obj_get_child(gauge, NULL);
lv_label_set_text(label, buf);
lv_obj_align(label, gauge, LV_ALIGN_IN_TOP_MID, 0, lv_obj_get_y(label));
}
边栏推荐
- AI助力,释放法务势能!iTerms合同智审系统重磅发布
- A - Eddy's AC puzzle (C language)
- 直播助力杭州电商独角兽冲击上市,分账系统重构电商交易新格局
- Detailed explanation of network time synchronization (NTP network timing) of video monitoring system
- Application of NTP network time server (PTP clock synchronization) in it network
- A.前缀极差(C语言)
- 7. list label
- SQL注入关联分析
- Red team shooting range with three-layer protection
- PMM monitoring Oracle
猜你喜欢

Construction of esp8266/esp32 development environment

三层带防护内网红队靶场

How to improve the efficiency of regression testing

Evil CSRF

华生·K的秘密日记

Shell script binary encryption

Notes on redisson distributed lock usage

Source insight 4.0 setting shortcut keys for comments and uncomments

人与人的一些不同

Sslstrip Ultimate - location hijacking
随机推荐
Chinese classics for children
关于重复发包的防护与绕过
Possible problems with password retrieval function (supplementary)
Market prospect analysis and Research Report of electronic pelletizing counter in 2022
Management system of College Students' associations based on SSM
GPS Beidou time service, NTP makes network clock synchronization more accurate
Rational use of thread pool and thread variables
[pan micro E9 development] single sign on Kingdee eas
7. 列表标签
Evil CSRF
Notes on redisson distributed lock usage
2022 年 5 月产品大事记
Code replicates CSRF attack and resolves it
SQL injection correlation analysis
App live broadcast source code, platform login page and password modification page
unforgettable moments
图像检测相关模型数据格式
如何提高回归测试效率
Market prospect analysis and Research Report of programmable digital temperature regulator in 2022
雷达辐射源调制信号仿真(代码)