当前位置:网站首页>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));
}
边栏推荐
- 强烈推荐这款神器,一行命令将网页转PDF!
- 邪恶的CSRF
- How to invest in programming knowledge and reduce the impact of knowledge failure
- 人与人的一些不同
- Writing shell scripts using vscode
- Vulkan-官方示例解读-RayTracingShadows&在这里边使用模型(1)
- Market prospect analysis and Research Report of surround packing machine in 2022
- GPS Beidou time service, NTP makes network clock synchronization more accurate
- Market prospect analysis and Research Report of pipe and hose press fitting tools in 2022
- WPF of open source project hero alliance
猜你喜欢
随机推荐
Maui migration guide
Linq. pdf
Exploitation and utilization of clickjacking vulnerability
Brew source change
Record a VMware problem
雷达辐射源调制信号仿真
Host computer development (how to develop host computer)
[signalr complete series] Net6 Zhongshi signalr communication
Embedded basic interface-i2c
什么样的人才是幸福的?
Implementation of one-dimensional convolutional neural network CNN based on FPGA (V) data quantization (with code)
Unity prefab scene 冲突合并工具 UnityYAMLMerge
密码找回功能可能存在的问题(补充)
Source Insight 4.0设置注释与反注释的快捷键
【CustomView】Glide+BitmapTransformation 图片上下边框波浪处理(WaveTransformation)
PHP正则用例
Esp32 porting lvgl
2022-06-10:薯队长从北向南穿过一片红薯地(南北长M,东西宽N),红薯地被划分为1x1的方格, 他可以从北边的任何一个格子出发,到达南边的任何一个格子, 但每一步只能走到东南、正南、西南方向的
Market prospect analysis and Research Report of surround packing machine in 2022
From function test to advanced automation test, I stayed up 7 days to sort out this 3000 word super complete learning guide [with network disk resources]









