Hey all
I am using PROS and I was trying to implement LVGL for brain screen.
I followed the instruction here: https://pros.cs.purdue.edu/v5/pros-4/display.html
and changed apix, yet it problem seems to
not fix.
Could anyone provide me with a help?
Thanks
When I include apix in my main.cpp
file (as opposed to letting vscode auto-include the headers individually, which I did before) it builds without errors, but that might be because I have probably changed some code in some of my header files to get LVGL to work. I don’t remember what I might have changed though. Quick fix should include the right libraries for you, but you are also using some newer LVGL syntax. PROS 4 uses LVGL 8.3.4, while the newest version is 9.2. Welcome to the documentation of LVGL! — LVGL documentation is the link for the documentation that you should use. For example, lv_screen_active()
should be replaced with lv_scr_act()
.
Lastly, if you want to use LVGL to make something complicated such as an auton selector but don’t have constant access to a brain, I would recommend using a simulator. I used GitHub - lvgl/lv_port_pc_vscode. I am on a mac, and this worked for me: First, follow the instructions in the github repo (GitHub - lvgl/lv_port_pc_vscode). I am pretty sure you have to install SDL2 (I have 2.30.6 and it works), not SDL3. You might have to change some settings in System Settings for it to work, but I don’t fully remember. After you do this, you have to follow the macos instructions in the readme. It should run at this point, and you should see a demo program. To more accurately simulate the V5 brain, you have to change a few settings. Go into lv_conf.h
and change the color depth to 24. Here is an example auton selector (put this into main.c
):
main.c.zip (2.8 KB). This is meant for dark mode, which can be enabled in lv_conf.h
by setting LV_THEME_DEFAULT_DARK
to 1 and LV_USE_THEME_SIMPLE
and LV_USE_THEME_MONO
to 0. The only two downsides to the simulator in my opinion are that it can sometimes take a really long time to build your code and that the simulator uses a newer version of LVGL, so you have to translate the code in order for it to work with PROS. This simulator should also work on other OS’s if you follow their respective instructions, but I have only tested it on MacOS, so I am not 100% sure if other ones will work.
1 Like