Raspberry Pi 7 inch Touchscreen rotate

◇◆丶佛笑我妖孽 提交于 2021-01-28 10:40:39

问题


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?


回答1:


Rotate official 7" Raspberry Touchscreen

1.install xinput:

sudo apt-get install xinput

2.to rotate the screen, edit this file:

sudo nano /boot/config.txt

and add this line at the end:

display_rotate=1

for the other direction, you can use:

display_rotate=3

exit(CTRL+X) and save.

3.create a script for flipping touchscreen every time raspbian boots:

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

add this line:

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

exit(CTRL+X) and save.

4.chmod this script:

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

5.to launch the script with the session, edit this file:

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

add this line at the end:

@/home/pi/Desktop/fliptouch.sh

exit(CTRL+X) and save.

6.Reboot:

sudo reboot

source: https://www.raspberrypi.org/forums/viewtopic.php?f=108&t=120793&start=50#p1084567



来源:https://stackoverflow.com/questions/35082747/raspberry-pi-7-inch-touchscreen-rotate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!