树莓派4B 设置 HDMI 分辨率设置 (设置800x400分辨率为例)【图文】

0.写在最前面

重要的事情说三遍:
先备份你的config.txt !
先备份你的config.txt !
先备份你的config.txt !
     首先我用的系统是官方系统,你的系统有可能和我不一致;已经有人出现用这种方法导致屏幕不亮,ssh无法连接(有一个系统和我有区别,config.txt中的内容和我的有区别)所以备份好你的 config.txt !
      我不知为什么会出现屏幕不亮,和SSH无法连接的问题,不过我的可以,而且我所更改的地方的参数的作用我都查过,没有动和SSH相关的

1. ssh 连接树莓派

在这里插入图片描述

2. 打开 /boot/config.txt

$ sudo nano /boot/config

在这里插入图片描述

3. 编辑以下内容

以下项中,有注释的取消注释,没有的项要添加
disable_overscan=1
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=800
(控制台framebuffer宽度,按需设置)
framebuffer_height=480 (控制台framebuffer高度,按需设置)
hdmi_force_hotplug=1 (即便没有检测到HDMI显示器也要使用HDMI模式,使用 VNC 的一定要设置
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
(分辨率800x480 60Hz , 自行修改为自己需要的)
hdmi_drive=2

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=800
framebuffer_height=480

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1 

# uncomment to force a specific HDMI mode (this will force VGA)
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d


在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4. Ctrl + O 回车 保存,然后 Ctrl + X 退出

在这里插入图片描述
在这里插入图片描述

5. 输入 sudo reboot 重启,重启后可成功显示桌面

$ sudo reboot

在这里插入图片描述

6. 7 寸屏显示效果

在这里插入图片描述

7. VNC 显示效果

在这里插入图片描述

  • 2
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值