• sales

    +86-0755-88291180

Luckfox_pico_Ultra Tutorial on how to automatically display lvgl GUI on Luckfox_pico_Ultra (W) when booting

2024-09-04 16:28:49 Ask

Tutorial on how to automatically display lvgl GUI on Luckfox_pico_Ultra (W) when booting

Luckfox_pico_Ultra
1answers
SpotPearGuestb6838
Answer time:
2024-09-04 16:32:48

Burn one of the following systems on luckfox_pico_Ultra

Get the source code of the LVGL sample program (on a virtual machine or Ubuntu host):


git clone https://github.com/luckfox-eng29/luckfox_lvgl.git

Cross-compile the sample program:

Compilation environment: WSL2 Ubuntu 22.02

mkdir build
cd build
export LUCKFOX_SDK_PATH=<absolute address of Luckfox Pico SDK>
cmake ..
make -j

Finally compiled executable file: luckfox_lvgl_demo

Use scp to copy the luckfox_lvgl_demo file to the development board:

sudo scp luckfox_lvgl_demo root@<your IP>:/

Check the running effect of luckfox_lvgl_demo:

Give luckfox_lvgl_demo executable permission:

chmod a+x ./luckfox_lvgl_demo

Execute luckfox_lvgl_demo program:

./luckfox_lvgl_demo

Display the GUI interface on the monitor

Set luckfox_lvgl_demo to start automatically at boot:

Create a script named S90LCD in the /etc/init.d/directory

nano /etc/init.d/S90LCD

The script content is as follows:

#!/bin/sh
case $1 in
start)
export LD_LIBRARY_PATH=/oem/usr/lib:$LD_LIBRARY_PATH
cd /root
echo "Starting your C program..."
/root/luckfox_lvgl_demo &
;;
stop)
echo "Stopping your C program..."
;;
*):
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

exit 0

Give the S90LCD script executable permissions

 chmod a+x /etc/init.d/S90LCD

Reboot to take effect

reboot


Like0

report