Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
4inch Square Capacitive Touch Screen LCD (C) For Raspberry Pi, 720×720, DPI, IPS, Toughened Glass Cover, Low Power Solution
This LCD can support Raspbian and Kali systems.
Please download the latest version of the image on the https://www.raspberrypi.org/software/
1) Download the compressed file to the PC, and unzip it to get the .img file.
2) Connect the TF card to the PC, use SDFormatter.exe software to format the TF card.
3) Open the Win32DiskImager.exe software, select the system image downloaded in step 1, and click‘Write’ to write the system image.
4) After the image has finished writing, open the config.txt file in the root directory of the TF card(/boot/), add the following code at the end of config.txt, then save and quit the TF card safely.
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
Note: For Raspberry Pi 4, you need to comment out dtoverlay=vc4-fkms-V3D.
5)Download the 4inch DPI LCD (C) DTBO file and extract 3 dtbo files. Copy these three files to the overlays directory (/boot/overlays/), as shown in the following figure:
6) Save and quit the TF card safely, and insert the TF card into the Raspberry Pi.
7) Insert the 4inch DPI LCD (C) into the 40PIN GPIO interface of the Raspberry Pi, power on the Raspberry Pi, and wait for about ten seconds to display normally.
Display Rotating
Add this statement in the config.txt file (the config file is located in the root directory of the TF card, which is named /boot):
display_rotate=1 #1:90;2: 180; 3: 270
And then restart the Raspberry Pi after saving.
sudo reboot
Touch Rotating
After the display is rotated, the position of 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:
5. save and reboot your Pi
sudo reboot
After completing these steps. The LCD could rotate 90 degrees both display and touch function.
Note:
90 degree: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
180 degree: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
270 degree: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
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
Reboot
sudo reboot
You can use the following commands to disable/enable the displaying.
vcgencmd display_power 0 vcgencmd display_power 1
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 by 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
The pins labeled "NC" below means 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 |