admin管理员组文章数量:1570359
HDMI屏:
1、显示旋转:
这样屏幕显示就旋转过来了,但点击屏幕会发现,我们手指往左或往右滑时,屏幕指针却实际上是往上或往上动的,这是因为触摸方向并没有旋转过来
2、触摸方向旋转
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
找到touchscreen这个section,添加如下一行:
Option "CalibrationMatrix" "0 -1 1 1 0 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"
LCD屏:
在config.txt文件最后,加入以下对应旋转角度的命令(config文件位于TF卡根目录,也可以通过命令访问:sudo nano /boot/config.txt):
- #旋转90度
- display_lcd_rotate=1
- dtoverlay=rpi-ft5406,touchscreen-swapped-x-y=1,touchscreen-inverted-x=1
- #旋转180度
- display_lcd_rotate=2
- dtoverlay=rpi-ft5406,touchscreen-inverted-x=1,touchscreen-inverted-y=1
- #旋转270度
- display_lcd_rotate=3
- dtoverlay=rpi-ft5406,touchscreen-swapped-x-y=1,touchscreen-inverted-y=1
注:如果是Raspberry Pi 4,还需要把dtoverlay=vc4-fkms-V3D注释掉
sudo reboot
就好了
版权声明:本文标题:树莓派触摸屏显示旋转+触摸旋转 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1727668059a1124848.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论