当前位置:网站首页>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);
- 运行效果

边栏推荐
- R language uses dplyr package group_ The by function and the summarize function calculate the mean and standard deviation of the target variables based on the grouped variables
- codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】
- WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
- 一文概览2D人体姿态估计
- Data Lake (13): spark and iceberg integrate DDL operations
- 迅为IMX6Q开发板QT系统移植tinyplay
- 递增的三元子序列[贪心训练]
- Chapter 16 string localization and message Dictionary (2)
- Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on GPIO)
- Talk about 10 tips to ensure thread safety
猜你喜欢

Practical puzzle solving | how to extract irregular ROI regions in opencv

The failure rate is as high as 80%. What are the challenges on the way of enterprise digital transformation?

Visual Studio调试方式详解

Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on GPIO)

Data Lake (13): spark and iceberg integrate DDL operations

Ultrasonic distance meter based on 51 single chip microcomputer

Real time data warehouse

STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于GPIO)

【MySQL从入门到精通】【高级篇】(五)MySQL的SQL语句执行流程

Data center concept
随机推荐
Ml: introduction, principle, use method and detailed introduction of classic cases of snap value
实战解惑 | OpenCV中如何提取不规则ROI区域
Data Lake (13): spark and iceberg integrate DDL operations
【算法leetcode】面试题 04.03. 特定深度节点链表(多语言实现)
游戏出海,全球化运营
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
Codeforce:c. sum of substrings
Excel quickly merges multiple rows of data
卷积神经网络经典论文集合(深度学习分类篇)
利用Shap值进行异常值检测
leetcode:6110. 网格图中递增路径的数目【dfs + cache】
RK1126平台OSD的实现支持颜色半透明度多通道支持中文
【MySQL从入门到精通】【高级篇】(五)MySQL的SQL语句执行流程
Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
如何游戏出海代运营、游戏出海代投
AI与生命科学
Digi重启XBee-Pro S2C生产,有些差别需要注意
Industrial Internet has greater development potential and more industry scenarios
Use of arouter
Intelligence d'affaires bi analyse financière, analyse financière au sens étroit et analyse financière au sens large sont - ils différents?