- Edit
/boot/firmware/config.txt. Add the following lines:
enable_uart=1
dtparam=spi=on
dtoverlay=piscreen,drm,speed=16000000
-
Open
sudo raspi-config. Under Advanced Options→Wayland, click X11. Then click OK & Finish. Don't reboot the Pi. -
Edit
/etc/X11/xorg.conf.d/99-fbdev.confAdd this configuration:
Section "Device"
Identifier "myfb"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
EndSection
-
Reboot your Pi
-
The touchscreen should show the desktop. However, touch may not be calibrated.
If your screen is not calibrated, you can try using my calibration by adding the following to /etc/X11/xorg.conf.d/98-ads7846-calibration.conf:
Section "InputClass"
Identifier "ADS7846 Calibration"
MatchProduct "ADS7846 Touchscreen"
Driver "libinput"
# Scales the axes and corrects the 180-degree Y-axis inversion
Option "TransformationMatrix" "1.1145 0 -0.0677 0 -1.1034 1.0577 0 0 1"
EndSection
If my calibration doesn't work, you can install xinput_calibrator. Then run DISPLAY=:0 xinput_calibrator & give the output to your favorite AI, along with these instructions