SainSmart 5 inch TFT LCD 800*480 Touch Screen Display for Raspberry Pi2/3
- The 5 inch TFT LCD module is a special design for Raspberry Pi for portable application.
Programming the image file
RPi LCD needs to use a SPI interface, but in the original image file of Raspberry Pi, the displayer is driven via a HDMI port. So the original image is not applicable for RPi LCD, and you should install the LCD driver to your Pi or use the Ready-to-use image file provided by Sainsmart,see the video here.
Apply the RPi LCD in a custom Raspbian system mirror image
In some cases, you may be inconvenient to use the image supplied by us, then you can install the LCD driver on an original system.
tar xvf LCD-show.tar.gz
- For 3.2inch RPi LCD, run the command:
- For 3.5inch RPi LCD, run the command:
- For 4inch RPi LCD, run the command:
- For 5inch RPi LCD, run the command:
Wait a few minutes, the system automatically restart, you can use normal Raspberry Pi LCD.
Touch screen calibration
This LCD can be calibrated using a program called xinput_calibrator which is pre-installed on the offer image. However, it was not pre-installed on original Raspbian OS. So in this case, you should get and install the program manually with
sudo apt-get install -y xinput-calibrator
Enter the following commands for touch screen calibration:
sudo DISPLAY=:0.0 xinput_calibrator
After running these commands, there will be a prompt for four-point calibration shown in the LCD screen. Click the points one by one to finish the touch calibration. Then, the new calibration data will be displayed in the terminal, as shows below. Please get these data for future use.
Doing dynamic recalibration: Setting new calibration data: 3950, 202, 298, 3863
Enter the following command to edit 99-calibration.conf:
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
Then, the old calibration data will be displayed in the terminal:
Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "Calibration" "3932 300 294 3801" Option "SwapAxes" "1" EndSection
Modify the calibration data to the new calibration data displayed in the step 2):
Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "Calibration" "3950 202 298 3863" Option "SwapAxes" "1" EndSection
Press the keys Ctrl+X, and select the option Y to save the modification.
The modification will be valid after rebooting the system. Enter the following command for system rebooting:
Notices: In case of inaccurate touch, please perform screen calibration again and reboot the system.