Hello! Today I will tell you how to use LVGL in your arduino projects simply.
You must take a few steps:
1. Update your Arduino core to version 0. 0. 5
2. Add these definitions to the inttypes. h file
#define PRId32 "d"
#define PRIu32 "u"
3.
Download the LVGL library through the library manager in the Arduino IDE
4. Prepare LVGL for work according to the instructions https: //docs. lvgl. io/latest/en/html/get-started/arduino. html#configure-lvgl exclude these points
5. Take this sketch as a test
w80x_test_lvgl. zip
The sketch uses the screen driver that I posted in the dialog
http: //ask. winnermicro. com/question/692. html
ILI9341_Fast_SDIO_SPI. zip - Download it. Connect the display to the board as described in this sketch.
If all the steps are completed, you will receive a picture on the screen
输入链接说明
If you have any difficulties - ask me
PS. . .
To do this, insert the header file in w80x_test_lvgl. ino
#include "demos/lv_demos. h"
Don't forget to follow the recommendation
You also need to copy lvgl/examples to lvgl/src/examples. Similarly for the demos lvgl/demos to lvgl/src/demos.
In lv_conf. h set parameter
/Benchmark your system/
#define LV_USE_DEMO_BENCHMARK 0 to 1
Commenting out a block of code
/ Create simple label /
Add a function call
lv_demo_benchmark () ;
And you can see how slowly it works. : )
It's not a problem! The bottleneck is the screen driver and the drawing method written in the my_disp_flush () function.
PPS.
So, we figured out the driver for Arduino which is an adapted simple version of the code provided by the isme expert. I uploaded a test sketch in the comments to this article. It even works stably : ) with FPS about 23-25
Your next step, in order to use the LVGL library very easily, should be to study SquareLine_Studio : ) You must learn how to drag-and-drop widgets and learn how to bind events to them. After this. your chakras will open and rapid growth in the embedder" s career is expected!
Looking ahead, I will say that working with SquareLine_Studio is no more difficult than qtDesigner. As a result, this system generates for us a project designed for an esp32 board:
It is enough to replace the screen driver and touch panel and delete the eTFT folder, and the project can be compiled and uploaded in Arduino framework to the w80x chip.
They write that using Studio is free for schoolchildren, students and pensioners : )
不愧是大佬!
Very good 我的 st7789 也可以正常运行了, 期待更好的优化
@AnatolSher 你好, 关于屏幕驱动程序有没有尝试过 Arduino_GFX library, 这也是一个很强大的驱动程序, 下面是他的网址
https: //github. com/moononournation/Arduino_GFX
我只试过兼容模式成功了, 速度比蜗牛还慢 , 可惜我不会移植
@xiaoxuesheng Arduino_GFX is not suitable for use in LVGL. For LVGL, you need to write your own driver using the capabilities of w80x chips
@xiaoxuesheng It can be made to work, but it will not be optimal and not productive.
@AnatolSher 你是对的
The driver does not use DMA, the current screen efficiency is very low, looking forward to improving it.
@isme I will be free next week and will continue to investigate this issue.
Hello friends! To complete the gestalt on LVGL drivers, I prepared a development board with W801 and PSRAM. This board will be a prototype of the navigation and autopilot system for my future yacht : )
This board will controling the lithium battery capacity, wind speed and direction, obtain GPS/GLONASS/Beidou data and time, control roll and magnetic heading, GSM data when the boat is within the coverage area of cellular operators, and so on to control the steering actuator. We plan to solve these tasks within the framework of the Arduino project. Stay with us. . . : )
Hello! The result I got when using DMA is this:
The benchmark worked only when using PSRAM and double buffering. However, normal use is possible without a PSRAM chip. A simple example sketch:
LVGL_Test_w801_no_psram. ZIP
As the project develops and we gain experience in using LVGL, we will expand the repository with new examples.
Using the driver as a template, you can independently write support for any LCD screen