• First Steps
  • General
  • Projects
Facebook Twitter YouTube
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
  • Hardware & GPIO
  • Sensors & Components
  • Scale
  • Cases
  • Fingerprint
  • Gas Sensor
  • Heartbeat
  • German
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
Home»Hardware & GPIO»Raspberry Pi LCD Touch Display Part 2 – Adjustments

Raspberry Pi LCD Touch Display Part 2 – Adjustments

Facebook Twitter LinkedIn Tumblr Email Reddit
tft lcd touch display
Share
Facebook Twitter LinkedIn Email Tumblr Reddit Telegram WhatsApp

In the first part of the tutorial, I showed how to connect and configure a touchscreen on the Raspberry Pi. In this part, I would like to show some settings that will improve the usage of the display.

 

Calibration

Calibration is often not too good when it comes to resistive touch displays. Therefore we calibrate again, for which Adafruit has a small program called Xinput-Calibrator.

Let’s start by loading and executing it.

wget http://adafruit-download.s3.amazonaws.com/xinput-calibrator_0.7.5-1_armhf.deb
sudo dpkg -i -B xinput-calibrator_0.7.5-1.deb

Now, if necessary, an older calibration must be deleted so that we can then overwrite our new one.

sudo rm /etc/X11/xorg.conf.d/99-calibration.conf

Then X is started on the screen and then the xinput-calibrator. If you have already started the screen (e.g. in autostart), the first line is not necessary:

FRAMEBUFFER=/dev/fb1 startx &
DISPLAY=:0.0 xinput_calibrator --misclick 0

It should start a new application that looks like this:

raspberry pi xinputHere you press (preferably with a stylus) on the red crosses (in all four corners). A code like this one should then appear in the console:

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "609 3246 302 2961"
EndSection

We now have to write this into the previously deleted file. You should firstly determine whether the directory exists (I didn’t have it) and create it if necessary:

ls /etc/X11/xorg.conf.d
sudo mkdir /etc/X11/xorg.conf.d

Now the configuration file is created.

sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Here you just copy the output “code” and save the file (CTRL + O, CTRL + X).

Your calibration is now saved and should take effect after a restart.

 

Screensaver Deactivation

You may have noticed that the screen turns on the screensaver after a few minutes. This is of course not looking good when the display is used continuously (with a GUI). However, this can also be prevented:

sudo apt-get install x11-xserver-utils

A file is now created in the home directory,

sudo nano ~/.xinitrc

which has the following content:

xset s off         # screensaver do not activate
xset -dpms         # DPMS (Energy Star) disable features.
xset s noblank     # do not let the video device darken

exec /etc/alternatives/x-session-manager      # start lxde

Every time the desktop is started, this script is called and will prevent the screen from darkening.

 

Playing Videos

A nice feature is letting videos run on the display. This can be done either by searching the file in the directory or simply starting a player from the console. I will show the latter in brief:

First, you need a player (e.g. the mplayer).

sudo apt-get install -y mplayer

If you have a video on the Pi, you can take it, otherwise simply download a test:

wget http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi

And now you can already play it (you can see additional options here).

mplayer -nolirc -vo fbdev2:/dev/fb1 -vf scale=320:-3 big_buck_bunny_480p_surround-fix.avi

 

Calibration spi stay awake tft lcd touch display watterott xinput-calibrator
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleLCD Touch Display (3.2″) on the Raspberry Pi
Next Article Raspberry Pi as a Jukebox (Spotify, Soundcloud, TuneIn, and much more) – Online Radio

Related Posts

How to build a ESP8266 Scale (with Weight Sensor HX711)

How-To: Bluetooth Connection between ESP32’s and Raspberry Pi’s

How to create a Solar Powered Raspberry Pi Bitcoin Miner

How to build a Smart Agriculture System using IoT

Leave A Reply Cancel Reply

PiCar-X: Build a smart, self-driving robot car with the Raspberry Pi

Raspberry Pi Bluetooth Data Transfer to the Smartphone

NodeMCU: Supply ESP8266 with Solar Cell and Battery with Power

Infrared Distance Measurement with the Raspberry Pi (Sharp GP2Y0A02YK0F)

Control a HD44780 LCD display via I2C with the Raspberry Pi

Raspberry Pi: Measure Humidity and Temperature with DHT11/DHT22

Subscribe to Blog
Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!
Subscribe

Thank you!

We will contact you soon.

Tutorials for Raspberry Pi
Facebook Twitter YouTube
  • Contact & Disclaimer

Type above and press Enter to search. Press Esc to cancel.