600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 树莓派触摸屏显示旋转+触摸旋转

树莓派触摸屏显示旋转+触摸旋转

时间:2022-06-17 15:48:47

相关推荐

树莓派触摸屏显示旋转+触摸旋转

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=1dtoverlay=rpi-ft5406,touchscreen-swapped-x-y=1,touchscreen-inverted-x=1#旋转180度display_lcd_rotate=2dtoverlay=rpi-ft5406,touchscreen-inverted-x=1,touchscreen-inverted-y=1#旋转270度display_lcd_rotate=3dtoverlay=rpi-ft5406,touchscreen-swapped-x-y=1,touchscreen-inverted-y=1

注:如果是Raspberry Pi 4,还需要把dtoverlay=vc4-fkms-V3D注释掉

sudo reboot

就好了

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。