Difference between revisions of "How to modify the display orientation-CTP(En)"

From LCD wiki
Jump to: navigation, search
(➞How to rotate Touch direction:)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="wikitable" border="1" style=" background-color: white;"
+
{{lan
|- style="background-color: #f2f2f2;text-align:center"
+
    |cn=http://www.lcdwiki.com/zh/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85%E8%99%9A%E6%8B%9F%E9%94%AE%E7%9B%98(CN)
| style="color: #ff0000; font-weight:bold;" align="center" |语言选择(Language):
+
    |en=http://www.lcdwiki.com/How_to_install_Soft_Keyboard  
| 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">'''This method is only suitable for HDMI capacitive screen, not suitable for GPIO resistive screen'''</font>
 
<font color="red">'''This method is only suitable for HDMI capacitive screen, not suitable for GPIO resistive screen'''</font>
 +
== <font color="blue">'''How to rotate display direction''':</font>  ==
  
== <font color="blue">'''How to rotate display direction''':</font>  ==
+
1. Open the “'''config.txt'''” file (the''' “config.txt” '''file is located in /boot):
1. Open the “'''config.txt'''” file (the “config.txt” file is located in /boot):
+
<pre style="border: 1px dashed black;color:black;width: 50%">
<pre style="border: 1px dashed red;color:red">
 
 
sudo nano /boot/config.txt
 
sudo nano /boot/config.txt
 
</pre>
 
</pre>
  
2.Add the statement in the “'''config.txt'''” file, press '''Ctrl+X''' to exit, press '''Y''' to save.
+
2.Add the statement in the “'''config.txt'''” file, press <font color="purple">'''Ctrl+X''' </font>to exit, press <font color="purple">'''Y''' </font>to save.
  
<pre style="border: 1px dashed red;color:red">display_rotate=1        #0: 0; 1: 90; 2: 180; 3: 270</pre>
+
<pre style="border: 1px dashed black;color:black;width: 50%">display_rotate=1        #0: 0; 1: 90; 2: 180; 3: 270</pre>
  
 
3. Restart the '''Raspberry Pi''' after saving.
 
3. Restart the '''Raspberry Pi''' after saving.
  
<pre style="border: 1px dashed red;color:red">sudo reboot</pre>
+
<pre style="border: 1px dashed black;color:black;width: 50%">sudo reboot</pre>
  
 
== <font color="blue">'''How to rotate Touch direction:'''</font>  ==
 
== <font color="blue">'''How to rotate Touch direction:'''</font>  ==
在进行显示旋转后,需要对触摸做出修改,否则不能与显示对应。
+
After the display is rotated, the touch needs to be modified.
  
1.   安装libinput
+
1.    Install '''libinput'''<pre style="border: 1px dashed black;color:black;width: 50%">
<pre style="border: 1px dashed red;color:red">
 
 
sudo apt-get install xserver-xorg-input-libinput
 
sudo apt-get install xserver-xorg-input-libinput
 
</pre>
 
</pre>
  
2.   在/etc/X11/下创建xorg.conf.d目录 (如果该目录已存在,则直接进行第3步)
+
2.   Create the''' xorg.conf. D '''directory in /etc/x11 / below (if the directory already exists, this will proceed directly to step 3)
<pre style="border: 1px dashed red;color:red">
+
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo mkdir /etc/X11/xorg.conf.d
 
sudo mkdir /etc/X11/xorg.conf.d
 
</pre>
 
</pre>
3.    复制40-libinput-conf 文件到刚刚创建的目录下
+
3.    Copy the file '''“40-libinput.conf”''' to the directory you just created.
<pre style="border: 1px dashed red;color:red">
+
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
 
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
 
</pre>
 
</pre>
4.    编辑/etc/X11/xorg.conf.d/40-libinput.conf
+
4.    Edit “/etc/X11/xorg.conf.d/40-libinput.conf”
<pre style="border: 1px dashed red;color:red">
+
<pre style="border: 1px dashed black;color:black;width: 50%">sudo nano /etc/X11/xorg.conf.d/40-libinput.conf   </pre>
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
+
Find a part of the  <font color="purple">'''touchscreen''' </font>, add the following statement inside, press <font color="purple">'''Ctrl+X''' </font>to exit, press <font color="purple">'''Y''' </font>to save.
 +
<pre style="border: 1px dashed black;color:black;width: 50%">
 +
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
 
</pre>
 
</pre>
找到 touchscreen的部分,在里面添加以下语句,然后按Ctrl+X键退出, 按Y键确定保存即可
+
[[File:MPI5001-Calibration.jpg|450x450像素|506x506px]]
 
 
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
 
 
 
例如:
 
 
 
[[File:MPI5001-Calibration.jpg|450x450像素|228x228px]]
 
  
5. 重启树莓派
+
5. Restar your '''Raspberry Pi'''
<pre style="border: 1px dashed red;color:red">
+
<pre style="border: 1px dashed black;color:black;width: 50%">
 
sudo reboot
 
sudo reboot
 
</pre>
 
</pre>
  
完成以上步骤即可进行90度旋转。
+
Complete the above steps for a 90 degree rotation.
  
注:
+
Note:
  
0 度旋转对应参数:  Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1"
+
0     degrees of rotation parameters:  Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1"
  
90 度旋转对应参数:  Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
+
90   degrees of rotation parameters:  Option "CalibrationMatrix" "0 1 0 0 -1 1 0 0 1"
  
180度旋转对应参数: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
+
180 degrees of rotation parameters:  Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
  
270度旋转对应参数: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
+
270 degrees of rotation parameters:  Option "CalibrationMatrix" "0-1 1 1 0 0 0 0 1"

Latest revision as of 11:58, 20 May 2018


语言选择

Languages

➤中文
➤EN


This method is only suitable for HDMI capacitive screen, not suitable for GPIO resistive screen

How to rotate display direction:

1. Open the “config.txt” file (the “config.txt” file is located in /boot):

sudo nano /boot/config.txt

2.Add the statement in the “config.txt” file, press Ctrl+X to exit, press Y to save.

display_rotate=1        #0: 0; 1: 90; 2: 180; 3: 270

3. Restart the Raspberry Pi after saving.

sudo reboot

How to rotate Touch direction:

After the display is rotated, the touch needs to be modified.

1.    Install libinput
sudo apt-get install xserver-xorg-input-libinput

2.  Create the xorg.conf. D directory in /etc/x11 / below (if the directory already exists, this will proceed directly to step 3)

sudo mkdir /etc/X11/xorg.conf.d

3.    Copy the file “40-libinput.conf” to the directory you just created.

sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/

4.    Edit “/etc/X11/xorg.conf.d/40-libinput.conf”

sudo nano /etc/X11/xorg.conf.d/40-libinput.conf   

Find a part of the touchscreen , add the following statement inside, press Ctrl+X to exit, press Y to save.

Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"

450x450像素

5. Restar your Raspberry Pi

sudo reboot

Complete the above steps for a 90 degree rotation.

Note:

0 degrees of rotation parameters:  Option "CalibrationMatrix" "1 0 0 0 1 0 0 0 1"

90 degrees of rotation parameters:  Option "CalibrationMatrix" "0 1 0 0 -1 1 0 0 1"

180 degrees of rotation parameters:  Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"

270 degrees of rotation parameters:  Option "CalibrationMatrix" "0-1 1 1 0 0 0 0 1"