Let me talk about the adding of a 3.5 inch TFT LCD touch display XPT2046 on Raspberry Pi. It is easy and straight forward. Plug the display on to the Raspberry Pi, with the pins flushed all the way to the corner. The touch screen should be illuminated white when the power source is connected to the Raspberry Pi.
As the IP address of Raspberry Pi are properly set, I connect my PC to Pi using Putty SSH. Then I execute
Sudo raspi-config
In the Interfacing options, go to SPI and set to Yes
Then, downloading the LCD-show driver off the github repo into your Raspberry Pi root folder by typing the following in the terminal.
git clone https://github.com/goodtft/LCD-show.git
Changing the permission of LCD35-show which allow everyone to read and execute the file, the owner is allowed to write to the file as well.
sudo chmod +x ~/LCD-show/LCD35-show
Now here’s the thing, the downside of this cheap touchscreen has cons whereby it can only run a single instance of display. i.e It can only run either the touchscreen OR your HDMI output.
To move your “screen” output onto the touchscreen, typing the following in the terminal.
cd LCD-show
sudo ./LCD35-show
Following that, the Raspberry Pi will undergo an automatic reboot. Once the reboot is complete, the display will appear on the touchscreen as depicted below.
To redirect the video to monitor via hdmi cable, typing the following in the terminal. Again, Pi will reboot automatically.
cd LCD-show
sudo ./LCD-hdmi