当前位置:网站首页>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);
- 运行效果
边栏推荐
- Ultrasonic distance meter based on 51 single chip microcomputer
- DDD application and practice of domestic hotel transactions -- Code
- 关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
- Vscode common plug-ins summary
- R语言使用dplyr包的mutate函数对指定数据列进行标准化处理(使用mean函数和sd函数)并基于分组变量计算标准化后的目标变量的分组均值
- WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
- R语言dplyr包summarise_if函数计算dataframe数据中所有数值数据列的均值和中位数、基于条件进行数据汇总分析(Summarize all Numeric Variables)
- Industrial Internet has greater development potential and more industry scenarios
- 2022 game going to sea practical release strategy
- STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于GPIO)
猜你喜欢
Sqlserver functions, creation and use of stored procedures
Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value
C# wpf 实现截屏框实时截屏功能
An overview of 2D human posture estimation
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
[MySQL from introduction to proficiency] [advanced chapter] (IV) MySQL permission management and control
商業智能BI財務分析,狹義的財務分析和廣義的財務分析有何不同?
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
【信息检索】链接分析
MATLAB中tiledlayout函数使用
随机推荐
R语言ggplot2可视化:gganimate包创建动态折线图动画(gif)、使用transition_reveal函数在动画中沿给定维度逐步显示数据
Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
Test evaluation of software testing
Rich text editing: wangeditor tutorial
Data Lake (13): spark and iceberg integrate DDL operations
游戏出海,全球化运营
vscode 常用插件汇总
Chapter 16 string localization and message Dictionary (2)
Leetcode 61: 旋转链表
Chapter 17 process memory
Leetcode T47: 全排列II
第十六章 字符串本地化和消息字典(二)
Fs4059c is a 5V input boost charging 12.6v1.2a. Inputting a small current to three lithium battery charging chips will not pull it dead. The temperature is 60 ° and 1000-1100ma is recommended
Ultrasonic distance meter based on 51 single chip microcomputer
scratch古堡历险记 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
按照功能对Boost库进行分类
软件测试之测试评估
Data center concept
商业智能BI财务分析,狭义的财务分析和广义的财务分析有何不同?
产业互联网则具备更大的发展潜能,具备更多的行业场景