树莓派4b安装ubuntu20.04并设置7寸触摸屏

树莓派4b安装ubuntu20.04并设置7寸触摸屏

  • ubuntu20.04镜像下载
    • 烧录镜像
    • ubuntu20.04配置
    • 配置7寸触摸显示器

ubuntu20.04镜像下载

ubuntu官方系统下载网址,选择20.04lot版本进行下载

https://ubuntu.com/download/raspberry-pi

烧录镜像

烧录镜像有多种方式可以选择。
(1)镜像烧录软件 Etcher

https://www.balena.io/etcher/

(2)树莓派官方烧录工具

https://www.raspberrypi.org/software/

选择要烧录的镜像,选择盘符进行系统烧录

ubuntu20.04配置

将内存卡插入树莓派,树莓派连接网线,开机。首次进入,账号密码均为ubuntu。

换源,这里换中科大的源

ubuntu@ubuntu:~$ sudo vi /etc/apt/sources.list

用vi编辑器将里面所有的ports.ubuntu.com更换为mirrors.ustc.edu.cn

:%s/ports.ubuntu.com/mirrors.ustc.edu.cn

vi编辑器退出并保存shift+zz,(正常退出:q)

然后更新并安装桌面

sudo apt update
sudo apt upgrade

apt-get install ubuntu-desktop

现在可以使用带桌面的ubuntu20.04系统了。

配置7寸触摸显示器

7寸显示器hdmi接口连接树莓派hdmi接口,7寸显示器的触摸接口连接树莓派USB接口,显示器无需接电源。在开机之前需要配置树莓派config.txt文件才可以使用7寸屏幕,否则会黑屏。
拔出tf存储卡,连接电脑,打开boot目录下的config.txt,在config.txt最下面添加如下代码:

disable_overscan=1
hdmi_force_hotplug=1  # 强制树莓派使用HDMI端口,即使树莓派没有检测到显示器连接仍然使用HDMI端口。
#该值为0时允许树莓派尝试检测显示器,当该值为1时,强制树莓派使用HDMI。
hdmi_drive=2  # 可以使用该配置项来改变HDMI端口的电压输出:
# 1-DVI输出电压。该模式下,HDMI输出中不包含音频信号。
# 2-HDMI输出电压。该模式下,HDMI输出中包含音频信号。
hdmi_group=2  # 决定的分辨率
# DMT分辨率是hdmi_group=2,计算机显示器使用的分辨率;hdmi_group=1是CEA分辨率 ,CEA规定的电视规格分辨率
hdmi_mode=4 

以下为hdmi_mode

hdmi_mode=1    640x350   85Hz
hdmi_mode=2    640x400   85Hz
hdmi_mode=3    720x400   85Hz
hdmi_mode=4    640x480   60Hz
hdmi_mode=5    640x480   72Hz
hdmi_mode=6    640x480   75Hz
hdmi_mode=7    640x480   85Hz
hdmi_mode=8    800x600   56Hz
hdmi_mode=9    800x600   60Hz
hdmi_mode=10   800x600   72Hz
hdmi_mode=11   800x600   75Hz
hdmi_mode=12   800x600   85Hz
hdmi_mode=13   800x600   120Hz
hdmi_mode=14   848x480   60Hz
hdmi_mode=15   1024x768  43Hz  DO NOT USE
hdmi_mode=16   1024x768  60Hz
hdmi_mode=17   1024x768  70Hz
hdmi_mode=18   1024x768  75Hz
hdmi_mode=19   1024x768  85Hz
hdmi_mode=20   1024x768  120Hz
hdmi_mode=21   1152x864  75Hz
hdmi_mode=22   1280x768        reduced blanking
hdmi_mode=23   1280x768  60Hz
hdmi_mode=24   1280x768  75Hz
hdmi_mode=25   1280x768  85Hz
hdmi_mode=26   1280x768  120Hz reduced blanking
hdmi_mode=27   1280x800        reduced blanking
hdmi_mode=28   1280x800  60Hz
hdmi_mode=29   1280x800  75Hz
hdmi_mode=30   1280x800  85Hz
hdmi_mode=31   1280x800  120Hz reduced blanking
hdmi_mode=32   1280x960  60Hz
hdmi_mode=33   1280x960  85Hz
hdmi_mode=34   1280x960  120Hz reduced blanking
hdmi_mode=35   1280x1024 60Hz
hdmi_mode=36   1280x1024 75Hz
hdmi_mode=37   1280x1024 85Hz
hdmi_mode=38   1280x1024 120Hz reduced blanking
hdmi_mode=39   1360x768  60Hz
hdmi_mode=40   1360x768  120Hz reduced blanking
hdmi_mode=41   1400x1050       reduced blanking
hdmi_mode=42   1400x1050 60Hz
hdmi_mode=43   1400x1050 75Hz
hdmi_mode=44   1400x1050 85Hz
hdmi_mode=45   1400x1050 120Hz reduced blanking
hdmi_mode=46   1440x900        reduced blanking
hdmi_mode=47   1440x900  60Hz
hdmi_mode=48   1440x900  75Hz
hdmi_mode=49   1440x900  85Hz
hdmi_mode=50   1440x900  120Hz reduced blanking
hdmi_mode=51   1600x1200 60Hz
hdmi_mode=52   1600x1200 65Hz
hdmi_mode=53   1600x1200 70Hz
hdmi_mode=54   1600x1200 75Hz
hdmi_mode=55   1600x1200 85Hz
hdmi_mode=56   1600x1200 120Hz reduced blanking
hdmi_mode=57   1680x1050       reduced blanking
hdmi_mode=58   1680x1050 60Hz
hdmi_mode=59   1680x1050 75Hz
hdmi_mode=60   1680x1050 85Hz
hdmi_mode=61   1680x1050 120Hz reduced blanking
hdmi_mode=62   1792x1344 60Hz
hdmi_mode=63   1792x1344 75Hz
hdmi_mode=64   1792x1344 120Hz reduced blanking
hdmi_mode=65   1856x1392 60Hz
hdmi_mode=66   1856x1392 75Hz
hdmi_mode=67   1856x1392 120Hz reduced blanking
hdmi_mode=68   1920x1200       reduced blanking
hdmi_mode=69   1920x1200 60Hz
hdmi_mode=70   1920x1200 75Hz
hdmi_mode=71   1920x1200 85Hz
hdmi_mode=72   1920x1200 120Hz reduced blanking
hdmi_mode=73   1920x1440 60Hz
hdmi_mode=74   1920x1440 75Hz
hdmi_mode=75   1920x1440 120Hz reduced blanking
hdmi_mode=76   2560x1600       reduced blanking
hdmi_mode=77   2560x1600 60Hz
hdmi_mode=78   2560x1600 75Hz
hdmi_mode=79   2560x1600 85Hz
hdmi_mode=80   2560x1600 120Hz reduced blanking
hdmi_mode=81   1366x768  60Hz
hdmi_mode=82   1080p     60Hz
hdmi_mode=83   1600x900        reduced blanking
hdmi_mode=84   2048x1152       reduced blanking
hdmi_mode=85   720p      60Hz
hdmi_mode=86   1366x768        reduced blanking

树莓派ubuntu20.04配置完成

参考文章链接:
[1]: https://blog.csdn.net/fuck_hang/article/details/105766070?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.control
[2]: https://blog.csdn.net/xxyyeezqnq/article/details/51495554?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.control
[3]: https://blog.csdn.net/qq825255961/article/details/106042876
[4]: https://bbs.elecfans.com/jishu_805971_1_1.html

你可能感兴趣的:(树莓派,ubuntu)