Open the file “/boot/userconfig.txt”:
sudo nano /boot/userconfig.txt
Add the following lines:
dtparam=spi=on
hdmi_drive=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
dtoverlay=ads7846
dtparam=cs=1
dtparam=penirq=25
dtparam=penirq_pull=2
dtparam=speed=50000
dtparam=swapxy=0
dtparam=pmax=255
dtparam=xohms=150
dtparam=xmin=200
dtparam=xmax=3900
dtparam=ymin=200
dtparam=ymax=3900
To close nano and save “/boot/userconfig.txt” type Ctrl+x, y and Enter.
Reboot.