Difference between revisions of "4inch DPI LCD (C)"
(→Others) |
|||
(32 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<div class="wiki-pages jet-green-color"> | <div class="wiki-pages jet-green-color"> | ||
{{Infobox item | {{Infobox item | ||
− | |img=[[File:4inch-DPI-LCD-C-1.jpg|300px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/4inch-dpi-lcd-c.htm}}]] | + | |img=[[File:4inch-DPI-LCD-C-1.jpg|300px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/4inch-dpi-lcd-c.htm?amazon}}]] |
− | |caption=4inch Square Capacitive Touch Screen LCD (C) for Raspberry Pi, | + | |caption=4inch Square Capacitive Touch Screen LCD (C) for Raspberry Pi, 720 × 720, DPI, IPS |
|platform=Raspberry Pi | |platform=Raspberry Pi | ||
|category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]], [[:Category:Raspberry Pi LCD|Raspberry Pi LCD]] | |category=[[:Category:OLEDs / LCDs|OLEDs / LCDs]], [[:Category:LCD|LCD]], [[:Category:Raspberry Pi LCD|Raspberry Pi LCD]] | ||
Line 17: | Line 17: | ||
<div class="tabbertab" title="Instruction"> | <div class="tabbertab" title="Instruction"> | ||
= '''Introduction''' = | = '''Introduction''' = | ||
− | 4inch Square Capacitive Touch Screen LCD (C) for Raspberry Pi, | + | 4inch Square Capacitive Touch Screen LCD (C) for Raspberry Pi, 720 × 720, DPI, IPS, toughened glass cover, low power solution. |
== '''Features''' == | == '''Features''' == | ||
− | *4inch IPS | + | *4inch IPS Display, 720 x 720 hardware resolution. |
*Designed for Raspberry Pi, based on Raspberry Pi 40pin GPIO interface. | *Designed for Raspberry Pi, based on Raspberry Pi 40pin GPIO interface. | ||
*Using DPI666 interface of Raspberry Pi to drive LCD, refresh rate up to 60Hz. | *Using DPI666 interface of Raspberry Pi to drive LCD, refresh rate up to 60Hz. | ||
− | *Drive capacitive touch through I2C interface of Raspberry Pi, 5- | + | *Drive capacitive touch through I2C interface of Raspberry Pi, 5-point touch, toughened glass panel, hardness up to 6H. |
*Supports Raspberry Pi OS / Ubuntu / Kali systems. | *Supports Raspberry Pi OS / Ubuntu / Kali systems. | ||
Line 34: | Line 34: | ||
If you don't know the difference between the two branches of Raspberry Pi OS, you can check the following introduction [[#Introducing the Raspberry Pi OS fork]] | If you don't know the difference between the two branches of Raspberry Pi OS, you can check the following introduction [[#Introducing the Raspberry Pi OS fork]] | ||
=== For Raspberry Pi OS Bullseye branch === | === For Raspberry Pi OS Bullseye branch === | ||
− | Please download the latest version of the image from the [https://www.raspberrypi.com/software/operating-systems/ Raspberry Pi official website]. | + | Please download the latest version of the image from the [https://www.raspberrypi.com/software/operating-systems/ Raspberry Pi official website].<br/> |
1. Download the compressed file to the PC, and extract the img file.<br /> | 1. Download the compressed file to the PC, and extract the img file.<br /> | ||
− | 2. Connect the TF card to the PC and use [https:// | + | 2. Connect the TF card to the PC and use [https://files.waveshare.com/upload/d/d7/Panasonic_SDFormatter.zip SDFormatter] to format the TF card.<br /> |
− | 3. Open the [https:// | + | 3. Open the [https://files.waveshare.com/upload/7/76/Win32DiskImager.zip Win32DiskImager] software, select the system image prepared in step 1, and click write to burn the system image.<br /> |
− | 4. After the programming is completed, open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt and save it | + | 4. After the programming is completed, open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt, and save it. |
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
dtoverlay=vc4-kms-v3d | dtoverlay=vc4-kms-v3d | ||
Line 47: | Line 47: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
5. Download the [https://www.waveshare.net/w/upload/8/8a/4DPIC-DTBO.zip 4inch DPI LCD (C)-KMS display file] and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.<br /> | 5. Download the [https://www.waveshare.net/w/upload/8/8a/4DPIC-DTBO.zip 4inch DPI LCD (C)-KMS display file] and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.<br /> | ||
− | 6 | + | 6. Insert the TF card into the Raspberry Pi, power on the Raspberry Pi, and wait for about thirty seconds to display normally. |
− | |||
=== For Raspberry Pi OS Buster branch and Ubuntu system === | === For Raspberry Pi OS Buster branch and Ubuntu system === | ||
Line 69: | Line 68: | ||
</source> | </source> | ||
2. Download the [https://www.waveshare.net/w/upload/8/8a/4DPIC-DTBO.zip 4inch DPI LCD (C)-KMS display file] and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.<br /> | 2. Download the [https://www.waveshare.net/w/upload/8/8a/4DPIC-DTBO.zip 4inch DPI LCD (C)-KMS display file] and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.<br /> | ||
− | 3 | + | 3. Insert the TF card into the Raspberry Pi, power on the Raspberry Pi, and wait for about thirty seconds to display normally. |
− | |||
==Introducing the Raspberry Pi OS fork== | ==Introducing the Raspberry Pi OS fork== | ||
− | On December 2, 2021, the Raspberry Pi OS for Raspberry Pi split into two branches, the Buster branch and the Bullseye branch.<br /> | + | On December 2, 2021, the Raspberry Pi OS for Raspberry Pi split into two branches, the Buster branch, and the Bullseye branch.<br /> |
The Buster branch is a continuation of the old system, which is more stable and uses raspicam as the default camera subsystem.<br /> | The Buster branch is a continuation of the old system, which is more stable and uses raspicam as the default camera subsystem.<br /> | ||
The Bullseye branch adds some new features, including KMS as the default display driver and libcamera as the default camera subsystem.<br /> | The Bullseye branch adds some new features, including KMS as the default display driver and libcamera as the default camera subsystem.<br /> | ||
− | [https://www.raspberrypi.com/software/operating-systems/ Image download address] | + | [https://www.raspberrypi.com/software/operating-systems/ Image download address]<br /> |
[[File:RASPBERRY-PI-OS-BUSTER-BULLSEYE-04-01.png|800px]]<br /> | [[File:RASPBERRY-PI-OS-BUSTER-BULLSEYE-04-01.png|800px]]<br /> | ||
More detailed information can be found at:<br /> | More detailed information can be found at:<br /> | ||
Line 88: | Line 86: | ||
[https://downloads.raspberrypi.org/raspios_armhf/release_notes.txt Bullseye Release Notes] | [https://downloads.raspberrypi.org/raspios_armhf/release_notes.txt Bullseye Release Notes] | ||
− | Notes:The above information was updated on January 24, 2022. Due to the frequent update of the Raspberry Pi image, when you see this information, the relevant information may be out of date. The actual performance of the image shall prevail. This is for reference only. | + | Notes: The above information was updated on January 24, 2022. Due to the frequent update of the Raspberry Pi image, when you see this information, the relevant information may be out of date. The actual performance of the image shall prevail. This is for reference only. |
== Screen orientation settings == | == Screen orientation settings == | ||
− | ==== Update software version ==== | + | ====<big>Update software version</big>==== |
Raspberry Pi OS Bullseye branch needs to update the software version, and this step can be omitted for other systems. | Raspberry Pi OS Bullseye branch needs to update the software version, and this step can be omitted for other systems. | ||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
Line 97: | Line 95: | ||
sudo apt-get full-upgrade | sudo apt-get full-upgrade | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | ====Raspberry Pi OS and Kali display rotation ==== | + | ====<big>Raspberry Pi OS and Kali display rotation</big>==== |
− | First check whether the KMS or FKMS driver is loaded on the system you are using. | + | First, check whether the KMS or FKMS driver is loaded on the system you are using. |
Check method: In /boot/config.txt, check whether the line dtoverlay=vc4-kms-v3d or dtoverlay=vc4-fkms-v3d is turned on. | Check method: In /boot/config.txt, check whether the line dtoverlay=vc4-kms-v3d or dtoverlay=vc4-fkms-v3d is turned on. | ||
− | + | *With KMS or FKMS driver loaded | |
Use the following command for display rotation: | Use the following command for display rotation: | ||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
Line 111: | Line 109: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | *No KMS or FKMS driver loaded | |
Use the following command for display rotation: | Use the following command for display rotation: | ||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
Line 122: | Line 120: | ||
'''Touch Rotating''' | '''Touch Rotating''' | ||
− | After the display is rotated, the position of touch is incorrect because the touch | + | After the display is rotated, the position of the touch is incorrect because the touch doesn't change with the display angle. So the touch also needs to be modified. |
− | 1.Install libinput. | + | 1. Install libinput. |
sudo apt-get install xserver-xorg-input-libinput | sudo apt-get install xserver-xorg-input-libinput | ||
Line 130: | Line 128: | ||
sudo apt install xserver-xorg-input-synaptics | sudo apt install xserver-xorg-input-synaptics | ||
− | 2.Create the xorg.conf.d directory under /etc/X11/ (if the directory already exists, proceed directly to step 3). | + | 2. Create the xorg.conf.d directory under /etc/X11/ (if the directory already exists, proceed directly to step 3). |
sudo mkdir /etc/X11/xorg.conf.d | sudo mkdir /etc/X11/xorg.conf.d | ||
− | 3.Copy the 40-libinput-conf file to the directory you created just now. | + | 3. Copy the 40-libinput-conf file to the directory you created just now. |
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/ | ||
− | 4.Edit this file. | + | 4. Edit this file. |
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf | sudo nano /etc/X11/xorg.conf.d/40-libinput.conf | ||
Line 144: | Line 142: | ||
[[File:touch roate.jpg]]<br /> | [[File:touch roate.jpg]]<br /> | ||
− | 5. save and reboot your Pi | + | 5. save and reboot your Pi. |
sudo reboot | sudo reboot | ||
− | After completing these steps. The LCD could rotate 90 degrees both display and touch function. | + | After completing these steps. The LCD could rotate 90 degrees for both the display and touch function. |
'''Note:''' | '''Note:''' | ||
− | 90 | + | 90 degrees: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" |
− | 180 | + | 180 degrees: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" |
− | 270 | + | 270 degrees: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1" |
='''Others'''= | ='''Others'''= | ||
− | ==Disable power saving | + | ==Disable power saving== |
− | If you want to keep the display turning on all the time, you can disable the power saving function.<br /> | + | If you want to keep the display turning on all the time, you can disable the power-saving function.<br /> |
Modify file lightdm.conf<br /> | Modify file lightdm.conf<br /> | ||
<pre> | <pre> | ||
Line 172: | Line 170: | ||
xserver-command=X -s 0 -dpms | xserver-command=X -s 0 -dpms | ||
</pre> | </pre> | ||
− | *-s # –Disable the display | + | *-s # –Disable the display protection. |
*dpms Disable power saving. | *dpms Disable power saving. | ||
Reboot<br /> | Reboot<br /> | ||
Line 194: | Line 192: | ||
# It should be 2.52 version | # It should be 2.52 version | ||
</pre> | </pre> | ||
− | Change the brightness | + | Change the brightness with the following command: |
<pre> | <pre> | ||
gpio -g mode 18 pwm #Set the pin for PWM | gpio -g mode 18 pwm #Set the pin for PWM | ||
Line 201: | Line 199: | ||
gpio -g pwm 18 1023 #Dimest | gpio -g pwm 18 1023 #Dimest | ||
gpio -g mode 18 out #Clean the GPIO | gpio -g mode 18 out #Clean the GPIO | ||
+ | </pre> | ||
+ | |||
+ | ===Raspberry Pi Long Right-click Software Installation=== | ||
+ | Test environment: 2022-04-04-raspios-bullseye-armhf 32-bit system.<br/> | ||
+ | Supported Models: Supports Waveshare Electronics DSI LCD, DPI LCD, and HDMI LCD capacitive touch screen series.<br/> | ||
+ | |||
+ | <source lang="c"> | ||
+ | wget https://files.waveshare.com/upload/1/18/Evdev-right-click-emulation.zip | ||
+ | unzip Evdev-right-click-emulation.zip | ||
+ | cd evdev-right-click-emulation | ||
+ | sudo apt install build-essential libevdev2 libevdev-dev | ||
+ | cd 'evdev-right-click-emulation' | ||
+ | sudo cp 'out/evdev-rce' '/usr/local/bin/' | ||
+ | sudo chmod +x '/usr/local/bin/evdev-rce' | ||
+ | </source> | ||
+ | Enter the command:<br/> | ||
+ | <pre>sudo evdev-rce</pre> | ||
+ | After running, you can touch and long press to realize the right-click function. | ||
+ | ====Set IP==== | ||
+ | <source lang="c"> | ||
+ | sudo usermod -G 'input' -a pi | ||
+ | echo 'uinput' | sudo tee -a /etc/modules | ||
+ | sudo nano /etc/udev/rules.d/99-uinput.rules | ||
+ | </source> | ||
+ | Add in 99-uinput.rules file.<br/> | ||
+ | <pre> | ||
+ | KERNEL=="uinput", MODE="0660", GROUP="input" | ||
+ | </pre> | ||
+ | save it and run it in the terminal.<br/> | ||
+ | <source lang="c"> | ||
+ | sudo udevadm control --reload-rules | ||
+ | sudo udevadm trigger | ||
+ | </source> | ||
+ | Then reboot:<br/> | ||
+ | <pre> | ||
+ | sudo reboot | ||
+ | </pre> | ||
+ | Run after reboot (no sudo needed at this point)<br/> | ||
+ | <pre> | ||
+ | evdev-rce | ||
+ | </pre> | ||
+ | After running, you can touch and long press to realize the right-click function.<br/> | ||
+ | ====Set Startup==== | ||
+ | Enter the terminal:<br/> | ||
+ | <pre> | ||
+ | sudo mkdir ~/.config/autostart | ||
+ | sudo nano ~/.config/autostart/right_click.desktop | ||
+ | </pre> | ||
+ | Add the following in right_click.desktop.<br/> | ||
+ | <pre> | ||
+ | [Desktop Entry] | ||
+ | Version=1.0 | ||
+ | Type=Application | ||
+ | Name=evdev-rce | ||
+ | GenericName=Enable long-press-to-right-click gesture | ||
+ | Exec=env LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200 /usr/local/bin/evdev-rce | ||
+ | Terminal=true | ||
+ | StartupNotify=false | ||
+ | #If you want to modify the sensitivity, you can modify the size of the two parameters, LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200. | ||
</pre> | </pre> | ||
== '''Interface''' == | == '''Interface''' == | ||
− | The pins labeled "NC" below | + | The pins labeled "NC" below mean that those pins of Raspberry Pi are not occupied by the LCD, and the user can use them for other applications. |
{|class="wikitable" | {|class="wikitable" | ||
! PIN NO. !! SYMBOL !! DESCRIPTION | ! PIN NO. !! SYMBOL !! DESCRIPTION | ||
Line 290: | Line 347: | ||
</div> | </div> | ||
<div class="tabbertab" title="Resources"> | <div class="tabbertab" title="Resources"> | ||
− | |||
− | |||
− | |||
− | === | + | = '''Resource''' = |
− | * [ | + | ==3D Drawing== |
− | + | *[https://files.waveshare.com/wiki/4inch%20DPI%20LCD%20(C)/4inch-dpi-lcd_c.zip 4inch DPI LCD(C) 3D Drawing] | |
− | |||
− | |||
− | |||
− | == | + | == Software == |
+ | * [https://files.waveshare.com/upload/d/d7/Panasonic_SDFormatter.zip Panasonic SDFormatter] | ||
+ | * [https://files.waveshare.com/upload/7/76/Win32DiskImager.zip Win32DiskImager] | ||
+ | * [https://files.waveshare.com/upload/5/56/Putty.zip PuTTY] | ||
== '''Anti-Piracy''' == | == '''Anti-Piracy''' == | ||
Line 307: | Line 361: | ||
== <font color=red>'''Beware of knock-offs'''</font> == | == <font color=red>'''Beware of knock-offs'''</font> == | ||
{{Beware of knock-offs}} | {{Beware of knock-offs}} | ||
− | + | ='''Support'''= | |
− | + | {{Servicebox1}} | |
− | |||
− | |||
− | {{ | ||
[[Category:OLEDs / LCDs|OLEDs / LCDs]] [[Category:LCD|LCD]] [[Category:Raspberry Pi|Raspberry Pi]] [[Category:Raspberry Pi LCD|Raspberry Pi LCD]] | [[Category:OLEDs / LCDs|OLEDs / LCDs]] [[Category:LCD|LCD]] [[Category:Raspberry Pi|Raspberry Pi]] [[Category:Raspberry Pi LCD|Raspberry Pi LCD]] | ||
</div> | </div> | ||
</div> | </div> |
Latest revision as of 11:36, 30 November 2023
| ||
Introduction
4inch Square Capacitive Touch Screen LCD (C) for Raspberry Pi, 720 × 720, DPI, IPS, toughened glass cover, low power solution.
Features
- 4inch IPS Display, 720 x 720 hardware resolution.
- Designed for Raspberry Pi, based on Raspberry Pi 40pin GPIO interface.
- Using DPI666 interface of Raspberry Pi to drive LCD, refresh rate up to 60Hz.
- Drive capacitive touch through I2C interface of Raspberry Pi, 5-point touch, toughened glass panel, hardness up to 6H.
- Supports Raspberry Pi OS / Ubuntu / Kali systems.
Using with Raspberry Pi
Hardware connection
Please install the display slowly on the 40PIN GPIO interface of the Raspberry Pi as shown below.
Software setting
If you don't know the difference between the two branches of Raspberry Pi OS, you can check the following introduction #Introducing the Raspberry Pi OS fork
For Raspberry Pi OS Bullseye branch
Please download the latest version of the image from the Raspberry Pi official website.
1. Download the compressed file to the PC, and extract the img file.
2. Connect the TF card to the PC and use SDFormatter to format the TF card.
3. Open the Win32DiskImager software, select the system image prepared in step 1, and click write to burn the system image.
4. After the programming is completed, open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt, and save it.
dtoverlay=vc4-kms-v3d dtoverlay=vc4-kms-DPI-4inch dtoverlay=waveshare-4dpic-3b-4b dtoverlay=waveshare-4dpic-3b dtoverlay=waveshare-4dpic-4b
5. Download the 4inch DPI LCD (C)-KMS display file and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.
6. Insert the TF card into the Raspberry Pi, power on the Raspberry Pi, and wait for about thirty seconds to display normally.
For Raspberry Pi OS Buster branch and Ubuntu system
1. Open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt, save and safely eject the TF card.
gpio=0-9=a2 gpio=12-17=a2 gpio=20-25=a2 dtoverlay=dpi24 enable_dpi_lcd=1 display_default_lcd=1 extra_transpose_buffer=2 dpi_group=2 dpi_mode=87 dpi_output_format=0x7f216 dpi_timings=720 0 46 2 42 720 0 16 2 18 0 0 0 60 0 60000000 6 dtoverlay=waveshare-4dpic-3b-4b dtoverlay=waveshare-4dpic-3b dtoverlay=waveshare-4dpic-4b
2. Download the 4inch DPI LCD (C)-KMS display file and put it in the /boot/overlays directory of the TF card, and eject the TF card safely.
3. Insert the TF card into the Raspberry Pi, power on the Raspberry Pi, and wait for about thirty seconds to display normally.
Introducing the Raspberry Pi OS fork
On December 2, 2021, the Raspberry Pi OS for Raspberry Pi split into two branches, the Buster branch, and the Bullseye branch.
The Buster branch is a continuation of the old system, which is more stable and uses raspicam as the default camera subsystem.
The Bullseye branch adds some new features, including KMS as the default display driver and libcamera as the default camera subsystem.
Image download address
More detailed information can be found at:
Notes: The above information was updated on January 24, 2022. Due to the frequent update of the Raspberry Pi image, when you see this information, the relevant information may be out of date. The actual performance of the image shall prevail. This is for reference only.
Screen orientation settings
Update software version
Raspberry Pi OS Bullseye branch needs to update the software version, and this step can be omitted for other systems.
sudo apt-get update sudo apt-get full-upgrade
Raspberry Pi OS and Kali display rotation
First, check whether the KMS or FKMS driver is loaded on the system you are using.
Check method: In /boot/config.txt, check whether the line dtoverlay=vc4-kms-v3d or dtoverlay=vc4-fkms-v3d is turned on.
- With KMS or FKMS driver loaded
Use the following command for display rotation:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart #Enter the command corresponding to the display rotation angle at the end of the autostart file, and it will take effect after rebooting the system. #0: rotate 0 degrees; 1: rotate 270 degrees; 2: rotate 180 degrees; 3: rotate 90 degrees xrandr -o 1
- No KMS or FKMS driver loaded
Use the following command for display rotation:
sudo nano /boot/config.txt #Enter the command corresponding to the display rotation angle at the end of the config.txt file, and it will take effect after rebooting the system. #0: rotate 0 degrees; 1: rotate 90 degrees; 2: rotate 180 degrees; 3: rotate 270 degrees display_rotate=3
Touch Rotating
After the display is rotated, the position of the touch is incorrect because the touch doesn't change with the display angle. So the touch also needs to be modified.
1. Install libinput.
sudo apt-get install xserver-xorg-input-libinput
If the system you installed is Ubuntu or Jetson Nano. The installation code is:
sudo apt install xserver-xorg-input-synaptics
2. Create the xorg.conf.d directory under /etc/X11/ (if the directory already exists, proceed directly to step 3).
sudo mkdir /etc/X11/xorg.conf.d
3. Copy the 40-libinput-conf file to the directory you created just now.
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
4. Edit this file.
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
Find the part of the touchscreen, add the following statement inside, and then save the file.
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
Similar to the picture below:
sudo reboot
After completing these steps. The LCD could rotate 90 degrees for both the display and touch function.
Note:
90 degrees: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
180 degrees: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
270 degrees: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
Others
Disable power saving
If you want to keep the display turning on all the time, you can disable the power-saving function.
Modify file lightdm.conf
sudo nano /etc/lightdm/lightdm.conf
Find the [SeatDefaults] option and uncomment the line"xserver-command", modify it as below:
#xserver-command=X
Modify this code to
xserver-command=X -s 0 -dpms
- -s # –Disable the display protection.
- dpms Disable power saving.
Reboot
sudo reboot
Turn on/off HDMI output
You can use the following commands to disable/enable the displaying.
vcgencmd display_power 0 vcgencmd display_power 1
Adjust brightness by PWM
Update wiringPi if you use Pi4.
wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # It should be 2.52 version
Change the brightness with the following command:
gpio -g mode 18 pwm #Set the pin for PWM gpio pwmc 100 gpio -g pwm 18 0 #Bightest gpio -g pwm 18 1023 #Dimest gpio -g mode 18 out #Clean the GPIO
Raspberry Pi Long Right-click Software Installation
Test environment: 2022-04-04-raspios-bullseye-armhf 32-bit system.
Supported Models: Supports Waveshare Electronics DSI LCD, DPI LCD, and HDMI LCD capacitive touch screen series.
wget https://files.waveshare.com/upload/1/18/Evdev-right-click-emulation.zip unzip Evdev-right-click-emulation.zip cd evdev-right-click-emulation sudo apt install build-essential libevdev2 libevdev-dev cd 'evdev-right-click-emulation' sudo cp 'out/evdev-rce' '/usr/local/bin/' sudo chmod +x '/usr/local/bin/evdev-rce'
Enter the command:
sudo evdev-rce
After running, you can touch and long press to realize the right-click function.
Set IP
sudo usermod -G 'input' -a pi echo 'uinput' | sudo tee -a /etc/modules sudo nano /etc/udev/rules.d/99-uinput.rules
Add in 99-uinput.rules file.
KERNEL=="uinput", MODE="0660", GROUP="input"
save it and run it in the terminal.
sudo udevadm control --reload-rules sudo udevadm trigger
Then reboot:
sudo reboot
Run after reboot (no sudo needed at this point)
evdev-rce
After running, you can touch and long press to realize the right-click function.
Set Startup
Enter the terminal:
sudo mkdir ~/.config/autostart sudo nano ~/.config/autostart/right_click.desktop
Add the following in right_click.desktop.
[Desktop Entry] Version=1.0 Type=Application Name=evdev-rce GenericName=Enable long-press-to-right-click gesture Exec=env LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200 /usr/local/bin/evdev-rce Terminal=true StartupNotify=false #If you want to modify the sensitivity, you can modify the size of the two parameters, LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200.
Interface
The pins labeled "NC" below mean that those pins of Raspberry Pi are not occupied by the LCD, and the user can use them for other applications.
PIN NO. | SYMBOL | DESCRIPTION |
---|---|---|
1 | NC | Power positive (3.3V power input) |
2 | 5V | Power positive (5V power input) |
3 | VSYNC | Vertical sync |
4 | 5V | Power positive (5V power input) |
5 | HSYNC | Horizontal sync |
6 | GND | Ground |
7 | B0 | RGB signal cable |
8 | G2 | RGB signal cable |
9 | GND | Ground |
10 | G3 | RGB signal cable |
11 | G5 | RGB signal cable |
12 | AUDIO | Audio output |
13 | TP_INT | Touch Panel interrupt |
14 | GND | Ground |
15 | R2 | RGB signal cable |
16 | R3 | RGB signal cable |
17 | NC | Power positive (3.3V power input) |
18 | R4 | RGB signal cable |
19 | TP_SDA | I2C SDA for touch panel |
20 | GND | Ground |
21 | B5 | RGB signal cable |
22 | R5 | RGB signal cable |
23 | TP_SCL | I2C SCL for touch panel |
24 | B4 | RGB signal cable |
25 | GND | Ground |
26 | B3 | RGB signal cable |
27 | LCD_CLK | LCD clock |
28 | DE | LCD data enable |
29 | B1 | RGB signal cable |
30 | GND | Ground |
31 | B2 | RGB signal cable |
32 | G0 | RGB signal cable |
33 | G1 | RGB signal cable |
34 | GND | Ground |
35 | NC | GPIO interface |
36 | G4 | RGB signal cable |
37 | NC | GPIO interface |
38 | R0 | RGB signal cable |
39 | GND | Ground |
40 | R1 | RGB signal cable |
Resource
3D Drawing
Software
Anti-Piracy
Since the first-generation Raspberry Pi released, Waveshare has been working on designing, developing, and producing various fantastic touch LCDs for the Pi. Unfortunately, there are quite a few pirated/knock-off products in the market. They're usually some poor copies of our early hardware revisions, and comes with none support service.
To avoid becoming a victim of pirated products, please pay attention to the following features when purchasing:
Beware of knock-offs
Please note that we've found some poor copies of this item in the market. They are usually made of inferior materials and shipped without any testing.
You might be wondering if the one you're watching or you've purchased in other non-official stores is original, feel free to contact us.
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)