Skip to content

Install tslib on Raspberry Pi

Calvin Hass edited this page Aug 18, 2019 · 5 revisions

Overview > Installing on Raspberry Pi >

The PiTFT install script includes a basic installation of the tslib touch library. We will start by testing to see if it can communicate with your touch display correctly.

Basic tslib test

ls -l /dev/input/touchscreen
sudo evtest /dev/input/touchscreen
  • image
  • Now touch the display and ensure coordinates are being written to the console:
  • image

Install tslib from sources

In order to enable libraries such as GUIslice to use tslib, we need to build the library from sources.

  • Install the prerequisites:
    • sudo apt-get install git automake libtool
  • Now compile and install tslib:
cd ~/dev
			git clone git://github.com/kergoth/tslib.git
cd tslib
./autogen.sh
./configure
make
sudo make install	
  • image
  • Now we can proceed by using evtest:
  • sudo evtest /dev/input/touchscreen

Set up local library

  • sudo cp -P /usr/local/lib/libts* /usr/lib/arm-linux-gnueabihf/

Test with ts_print

  • sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_print
  • image

Run GUIslice examples

cd ~/dev
cd GUIslice/examples/linux
make ex04_lnx_ctrls
sudo ./ex04_lnx_ctrls
Clone this wiki locally