导航菜单
Toggle navigation
英文主页
树莓派显示模块
树莓派HDMI
树莓派MHS显示屏
树莓派GPIO显示屏
SPI显示模块
常规SPI模块
Arduino SPI模块
全视角SPI模块
Arduino显示模块
Arduino UNO
Arduino Mega2560
其他显示模块
8/16位并口模块
OLED显示模块
RGB显示模块
开发板
显示屏
IPS彩屏
TN彩屏
OLED屏
查看“如何旋转显示和触摸(电容触摸)”的源代码
←
如何旋转显示和触摸(电容触摸)
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{| class="wikitable" border="1" style=" background-color: white;" |- style="background-color: #f2f2f2;text-align:center" | style="color: #ff0000; font-weight:bold;" align="center" |语言选择(Language): | style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/zh/LCD%E6%97%8B%E8%BD%AC%E6%98%BE%E7%A4%BA%E5%92%8C%E8%A7%A6%E6%91%B8%E7%9A%84%E6%96%B9%E6%B3%95 中文] | style=" font-weight:bold;" align="center" |[http://www.lcdwiki.com/How_to_modify_the_display_orientation-CTP(En) EN] |} <font color="red">'''本文操作只适用于树莓派HDMI电容触摸显示器,不适用于GPIO电阻屏'''</font> == <font color="blue">如何旋转显示:</font> == 1. 打开'''config.txt文件'''(config.txt文件位于Micro SD卡根目录,即/boot中): <pre style="border: 1px dashed red;color:red"> sudo nano /boot/config.txt </pre> 2. 在'''config.txt'''文件中加入语句 <pre style="border: 1px dashed red;color:red">display_rotate=1 #0: 0; 1: 90; 2: 180; 3: 270</pre> 3. 保存后重启树莓派即可 <pre style="border: 1px dashed red;color:red">sudo reboot</pre> == <font color="blue">'''如何旋转触摸:'''</font> == 在进行显示旋转后,需要对触摸做出修改,否则不能与显示对应。 1. 安装libinput <pre style="border: 1px dashed red;color:red"> sudo apt-get install xserver-xorg-input-libinput </pre> 2. 在/etc/X11/下创建xorg.conf.d目录 (如果该目录已存在,则直接进行第3步) <pre style="border: 1px dashed red;color:red"> sudo mkdir /etc/X11/xorg.conf.d </pre> 3. 复制40-libinput-conf 文件到刚刚创建的目录下 <pre style="border: 1px dashed red;color:red"> sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/ </pre> 4. 编辑/etc/X11/xorg.conf.d/40-libinput.conf <pre style="border: 1px dashed red;color:red"> sudo nano /etc/X11/xorg.conf.d/40-libinput.conf </pre> 找到 touchscreen的部分,在里面添加以下语句,然后按Ctrl+X键退出, 按Y键确定保存即可 Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" 例如: [[文件:MPI5001-Calibration.jpg|无|缩略图|450x450像素]] 5. 重启树莓派 <pre style="border: 1px dashed red;color:red"> sudo reboot </pre> 完成以上步骤即可进行90度旋转。 注: 0 度旋转对应参数: Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1" 90 度旋转对应参数: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" 180度旋转对应参数: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" 270度旋转对应参数: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
该页面使用的模板:
模板:Code
(
查看源代码
)
模板:Lan
(
查看源代码
)
返回至
如何旋转显示和触摸(电容触摸)
。