当前位置:网站首页>LVGL 8.2 LED
LVGL 8.2 LED
2022-07-04 13:07:00 【仙剑情缘】
创建3个LED示例
static void lv_example_led_1(void)
{
/*Create a LED and switch it OFF*/
lv_obj_t* led1 = lv_led_create(lv_scr_act()); //创建LED对象
lv_obj_align(led1, LV_ALIGN_CENTER, -80, 0); //LV_ALIGN_CENTER方式对齐-80,0
lv_led_off(led1); // LED OFF
/*Copy the previous LED and set a brightness*/
lv_obj_t* led2 = lv_led_create(lv_scr_act()); //创建LED对象
lv_obj_align(led2, LV_ALIGN_CENTER, 0, 0); //LV_ALIGN_CENTER方式对齐0,0
lv_led_set_brightness(led2, 150); //设置LED亮度
lv_led_set_color(led2, lv_palette_main(LV_PALETTE_RED)); // 红色
/*Copy the previous LED and switch it ON*/
lv_obj_t* led3 = lv_led_create(lv_scr_act()); //创建LED对象
lv_obj_align(led3, LV_ALIGN_CENTER, 80, 0); //LV_ALIGN_CENTER方式对齐80,0
lv_led_on(led3); // LED ON
}
运行效果

- 将第2个LED点亮
lv_led_on(led2);
- 运行效果

边栏推荐
- LiveData
- SqlServer函数,存储过程的创建和使用
- Leetcode t47: full arrangement II
- R language ggplot2 visualization: gganimate package creates dynamic line graph animation (GIF) and uses transition_ The reveal function displays data step by step along a given dimension in the animat
- Map of mL: Based on Boston house price regression prediction data set, an interpretable case is realized by using the map value to the LIR linear regression model
- 数据埋点的一些问题和想法
- Leetcode T49: 字母异位词分组
- Why should Base64 encoding be used for image transmission
- flink sql-client. SH tutorial
- Respect others' behavior
猜你喜欢

Codeforce:c. sum of substrings

商业智能BI财务分析,狭义的财务分析和广义的财务分析有何不同?
![递增的三元子序列[贪心训练]](/img/92/7efd1883c21c0e804ffccfb2231602.png)
递增的三元子序列[贪心训练]

Test process arrangement (3)

NowCoder 反转链表

一文概览2D人体姿态估计

The implementation of OSD on rk1126 platform supports color translucency and multi-channel support for Chinese

vscode 常用插件汇总

迅为IMX6Q开发板QT系统移植tinyplay
![去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]](/img/af/a1dcba6f45eb4ccc668cd04a662e9c.png)
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
随机推荐
第十七章 进程内存
Ultrasonic distance meter based on 51 single chip microcomputer
递增的三元子序列[贪心训练]
C # WPF realizes the real-time screen capture function of screen capture box
WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制
No servers available for service: xxxx
【算法leetcode】面试题 04.03. 特定深度节点链表(多语言实现)
AI and Life Sciences
MySQL stored procedure exercise
Ml: introduction, principle, use method and detailed introduction of classic cases of snap value
Supprimer les lettres dupliquées [avidité + pile monotone (maintenir la séquence monotone avec un tableau + Len)]
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
What is the difference between Bi financial analysis in a narrow sense and financial analysis in a broad sense?
Data warehouse interview question preparation
Leetcode t49: grouping of alphabetic words
Detailed index of MySQL
Leetcode T49: 字母异位词分组
电商系统中红包活动设计
[cloud native] how can I compete with this database?