美文网首页
littlevGL GUI例子使用

littlevGL GUI例子使用

作者: 招风小妖怪 | 来源:发表于2020-01-08 16:04 被阅读0次

首先你要有一个已经移植好了的工程

哔哩哔哩视频 https://b23.tv/av82484462/p1

第二步,下载这示例https://github.com/littlevgl/lv_examples

这是我已经移植好了的
这是github地址

开始移植

  1. 将下载的lv_examples-master复制到你的工程中,和lvgl同级目录下
  2. 将lv_examples-master重命名为lv_examples
  3. 将lv_examples文件中的lv_ex_conf_templ.h复制到lv_examples同级目录下
  4. 重命名lv_ex_conf_templ.h为lv_ex_conf.h,
  5. 打开lv_ex_conf.h,把#if 0 改成 #if 1
/**
 * @file lv_ex_conf.h
 *
 */
/*
 * COPY THIS FILE AS lv_ex_conf.h
 */

#if 1 /*Set it to "1" to enable the content*///就是这里

#ifndef LV_EX_CONF_H
#define LV_EX_CONF_H
.....

6.启用或禁用模块lv_ex_conf.h

  1. 在要用到示例的文件 #include "lv_examples.h",只需要包括这个文件的路径就可以了

下面是测试

  1. 测试函数 lv_test_theme_1(); 要#include "lv_test_theme_1.h"
  2. lv_ex_conf.h-> 0文件中 改为1 如下
/*******************
 *   TEST USAGE
 *******************/
#define LV_USE_TESTS        1
  1. lv_conf.h文件中 0 改为1
#define LV_USE_THEME_NIGHT      1   /*Dark elegant theme*/

4.最终添加

lv_theme_t * th = lv_theme_night_init(20, NULL);
lv_test_theme_1(th);

相关文章

网友评论

      本文标题:littlevGL GUI例子使用

      本文链接:https://www.haomeiwen.com/subject/tmlsactx.html