我该如何操作才能开机自动显示lvgl GUI
我该如何操作才能开机自动显示lvgl GUI
git clone https://github.com/luckfox-eng29/luckfox_lvgl.git
编译环境:WSL2 Ubuntu 22.02
mkdir build
cd build
export LUCKFOX_SDK_PATH=<Luckfox Pico SDK 的绝对地址>
cmake ..
make -j
最终编译生成的可执行文件: luckfox_lvgl_demo
sudo scp luckfox_lvgl_demo root@<your IP>:/
给luckfox_lvgl_demo可执行权限:
chmod a+x ./luckfox_lvgl_demo
执行luckfox_lvgl_demo程序:
./luckfox_lvgl_demo
在显示器显示GUI界面
在/etc/init.d/目录下创建一个名为S90LCD的脚本
nano /etc/init.d/S90LCD
脚本内容如下:
#!/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
给S90LCD脚本赋予可执行权限 chmod a+x /etc/init.d/S90LCD
重启即可生效
reboot
举报