There are many displays for Raspberry Pi and following some of the manufacturers instructions isn't always so easy.
But there are scripts available which will make it very simple.
As an example, in this post, I will install the LCD touch display from Joy-IT RB-TFT3.2-V2. The size is 3,2" with a resolution of 320 x 240, has a touch display and comes with 3 buttons.
After some Googling I found that the same display is made, or labeled, by different manufacturers so I used Waweshares instructions and their install script instead of Joy-IT:s.
Here you find Waveshares listing of available RPi LCD:s
Always start updating with
$ sudo apt update && sudo apt full-upgrade -y && sudo apt clean
continue with following commands
$ wget https://github.com/waveshare/LCD-show/archive/master.zip
$ unzip master.zip && mv LCD-show-master LCD-show
$ cd LCD-show/
$ ./LCD32-show
$ unzip master.zip && mv LCD-show-master LCD-show
$ cd LCD-show/
$ ./LCD32-show
The last command will install some software and end with a reboot of the RPi. If You succeeded the display will now show the booting process and the log on screen.
To calibrate the display You must log on, start a session, to the RPi using attached keyboard/mouse or via VNC/RDP and then in a terminal/ssh session issue the command
$ DISPLAY=:0.0 xinput_calibrator
(If You will get a message like Invalid MIT-MAGIC-COOKIE-1 keyUnable to connect to X server You haven't started with establishing a session)
After You have used a stylus and clicked on the 4 points, the display will show
Calibrating EVDEV driver for "ADS7846 Touchscreen" id=6
current calibration values (from XInput): min_x=219, max_x=3835 and min_y=3984, max_y=219
Doing dynamic recalibration:
Setting new calibration data: 244, 3783, 3849, 217
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "244 3783 3849 217"
EndSection
current calibration values (from XInput): min_x=219, max_x=3835 and min_y=3984, max_y=219
Doing dynamic recalibration:
Setting new calibration data: 244, 3783, 3849, 217
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "244 3783 3849 217"
EndSection
In my installations the file 99-calibration.conf didn't exist in the mentioned path so find it with
$ sudo find / -name "99-calibration.conf"
and then update the file with the 4 new "Calibration" values, could be,
$ sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf
If You want to use the buttons they are available at
- Key 1 => Pin 12 (GPIO18)
- Key 2 => Pin 16 (GPIO23)
- Key 3 => Pin 18 (GPIO24)
Some other display sources
No comments:
Post a Comment
Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !