Raspberry Pi 7英寸触摸屏旋转 [英] Raspberry Pi 7 inch Touchscreen rotate

查看:89
本文介绍了Raspberry Pi 7英寸触摸屏旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题: 我想在纵向(直立)模式下使用Raspberry PI 7英寸LCD. (Kivy应用程序) 我在/boot/config.txt上添加了:lcd_rotate = 2和display_rotate = 1 显示器还可以,但是触摸屏不好!触摸不能旋转90度. 如何将触摸屏旋转90度?

I have a small problem: I would like using Raspberry PI 7 inch LCD on portrait (standing) mode. (Kivy application) I added on /boot/config.txt: lcd_rotate=2 and display_rotate=1 The display is OK, but touch screen not good! The touch not rotating 90 degrees. How I rotate touch screen 90 degrees?

推荐答案

旋转官方7英寸Raspberry触摸屏

1. 安装xinput :

sudo apt-get install xinput

2. 要旋转屏幕,请编辑以下文件:

sudo nano /boot/config.txt

并在末尾添加以下行:

display_rotate=1

对于另一个方向,您可以使用:

for the other direction, you can use:

display_rotate=3

退出(CTRL + X)并保存.

exit(CTRL+X) and save.

3. 创建一个脚本,以在每次raspbian启动时翻转触摸屏:

sudo nano /home/pi/Desktop/fliptouch.sh

添加此行:

xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1

退出(CTRL + X)并保存.

exit(CTRL+X) and save.

4. 更改此脚本:

sudo chmod 777 /home/pi/Desktop/fliptouch.sh

5. 要在会话中启动脚本,请编辑以下文件:

sudo nano ~/.config/lxsession/LXDE-pi/autostart

在最后添加此行:

@/home/pi/Desktop/fliptouch.sh

退出(CTRL + X)并保存.

exit(CTRL+X) and save.

6. 重新启动:

sudo reboot

来源: 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆