树莓派LCD显示器安装步骤

3.5inch RPi LCD (A)

产品特点

  • 硬件分辨率为480×320
  • 电阻式触摸控制
  • 兼容并可直接插入任何版本树莓派
  • 提供驱动(支持Raspbian\Ubuntu\Kali和Retropie系统)
  • 支持FBCP软件驱动,可设置软件分辨率和双屏显示
  • 和你的树莓派一样大
  • 沉金工艺,精雕细琢

快速入门

硬件连接

连接GPIO接口,Raspberry Pi引出了40个GPIO管脚,而屏幕引出了26个管脚,连接时注意对应屏幕管脚和树莓派管脚。

您可以通过两种方法使用该LCD:方法一,给Raspbian/Ubuntu Mate/Kali和Retropie系统安装驱动。方法二,使用预装驱动的镜像。

方法一,安装驱动

请在树莓派官网下载最新版本的镜像(Raspbian/Ubuntu Mate/Kali或Retropie)。为了方便使用,这里提供Raspbian镜像

1) 将镜像文件下载到电脑上,并解压得到.img文件。

2) 将TF卡连接到电脑,打开Win32DiskImager.exe软件,选择第1步准备的.img文件,点击write烧写镜像。烧写完成后,安全弹出TF卡。

3) 将TF卡接入到树莓派上,启动树莓派,登录树莓派的终端(可以将树莓派接到HDMI显示器或用ssh远程登录)。

4) 先通过网络下载相关驱动代码,在执行相应的安装命令,在整个过程中确保可以正常联网

  1. git clone https://github.com/waveshare/LCD-show.git
  2. cd LCD-show/
  3. sudo ./LCD35-show

重启后即可使用(为了方便使用,可以调整屏幕显示方向,参见#设置显示方向)。

注意1:执行apt-get upgrade会导致LCD无法正常工作。此时需要编辑SD卡中的 config.txt 文件,并删除这一句:dtoverlay=ads7846。

注意2:在Raspbian-lite下,需要执行sudo ./LCD35-show lite命令,以安装驱动。

方法二,使用预装驱动的镜像

这里提供预装驱动的镜像,解压并把镜像写入到TF卡中(打开Win32DiskImager.exe软件,选择.img文件,点击「write」烧写镜像)。然后把卡插入树莓派就可以使用了。

设置显示方向

安装完触摸驱动后,可以通过运行以下命令修改屏幕旋转方向。

  1. cd LCD-show/
  2. #X可选0、90、180和270。分别表示LCD旋转0度、90度、180度和270度。
  3. sudo ./LCD35-show X

在Raspbian-lite下的旋转命令如下:

  1. cd LCD-show/
  2. #X可选0、90、180和270。分别表示LCD旋转0度、90度、180度和270度。
  3. sudo ./LCD35-show lite X

安装校准软件进行校准

  • 本LCD可以通过xinput-calibrator程序进行校准。
  • 运行以下命令,进行安装:
  1. sudo apt-get install xinput-calibrator
  • 点击任务栏的Menu键,选择Preferences -> Calibrate Touchscreen。
  • 按显示提示进行触摸校准。
  • 如果要保存这些触摸值,需要在以下路径新建一个99-calibration.conf文件(如果已存在则不需要新建)
  1. /etc/X11/xorg.conf.d/99-calibration.conf
  • 将触摸参数(不同LCD,下图数据可能不同)保存至99-calibration.conf,即可

5inch HDMI LCD FAQ1.jpg

安装虚拟键盘

1. 执行以下命令安装相应软件

  1. sudo apt-get update
  2. sudo apt-get install matchbox-keyboard
  3. sudo nano /usr/bin/toggle-matchbox-keyboard.sh

2. 复制以下内容到toggle-matchbox-keyboard.sh,保存退出

  1. #!/bin/bash
  2. #This script toggle the virtual keyboard
  3. PID=`pidof matchbox-keyboard`
  4. if [ ! -e $PID ]; then
  5. killall matchbox-keyboard
  6. else
  7. matchbox-keyboard &
  8. fi

3. 执行以下命令

  1. sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh
  2. sudo mkdir /usr/local/share/applications
  3. sudo nano /usr/local/share/applications/toggle-matchbox-keyboard.desktop

4. 复制以下内容到toggle-matchbox-keyboard.desktop,保存退出

  1. [Desktop Entry]
  2. Name=Toggle Matchbox Keyboard
  3. Comment=Toggle Matchbox Keyboard`
  4. Exec=toggle-matchbox-keyboard.sh
  5. Type=Application
  6. Icon=matchbox-keyboard.png
  7. Categories=Panel;Utility;MB
  8. X-MB-INPUT-MECHANSIM=True

5. 执行以下命令,注意该步骤必须使用"pi"用户权限,如果使用管理员权限,将找不到该文件

sudo nano /etc/xdg/lxpanel/LXDE-pi/panels/panel

6. 找到类似以下命令(不同版本的图标可能有一定差异)

  1. Plugin {
  2. type = launchbar
  3. Config {
  4. Button {
  5. id=lxde-screenlock.desktop
  6. }
  7. Button {
  8. id=lxde-logout.desktop
  9. }
  10. }

7. 加入以下代码以新增一个Button项,如下图

  1. Button {
  2. id=/usr/local/share/applications/toggle-matchbox-keyboard.desktop
  3. }

RPILCD-INSTALL-KEYBOARD01.png

8. 执行以下命令重启系统,正常可以看到左上角多了一个虚拟键盘的图标

  1. sudo reboot
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
树莓派LCD驱动/2.8/3.2/3.5/3.97/4.3/5/7等! You can focus on the following GitHub web site, for the latest lcd drivers: https://github.com/goodtft/LCD-show =============================================================================================================== "LCD-show-170315.tar.gz" just for Raspbian (Release date:2017-03-02) or later, DO NOT use it for the Raspbian version before 2017-03-02. ================================================================================================================ "LCD-show-160701.tar.gz" support Raspbian version before Raspbian-2017-02-16,such as(2017-02-16,2017-01-11, 2016-11-25,2016-09-23,2016-05-27,2016-05-10,2016-03-18,or earlier). And This Driver also tesed on "kali-2.1.2" ,"ubuntu-mate-16.04-beta2" ================================================================================================================ How to Install: 1.)Step1, Install Raspbian official mirror a)Download Raspbian official mirror: https://www.raspberrypi.org/downloads/ b)Use“SDFormatter.exe”to Format your TF Card c)Use“Win32DiskImager.exe” Burning mirror to TF Card 2.) Step2, Clone my repo onto your pi git clone https://github.com/goodtft/LCD-show.git chmod -R 755 LCD-show cd LCD-show/ 3.)Step3, According to your LCD's type, excute: In case of 2.8" LCD sudo ./LCD28-show In case of 3.2" LCD sudo ./LCD32-show In case of 3.5" LCD sudo ./LCD35-show In case of 3.97" LCD sudo ./LCD397-show In case of 4.3" LCD sudo ./LCD43-show In case of 5" LCD sudo ./LCD5-show In case of 7inch(B)-800X480 RPI LCD sudo ./LCD7B-show In case of 7inch(C)-1024X600 RPI LCD sudo ./LCD7C-show If you need to switch back to the traditional HDMI display sudo ./LCD-hdmi Wait a few minutes,the system will restart automaticall , enjoy with your LCD.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值