Skip to content

Install tslib on Raspberry Pi

Gary edited this page Jun 20, 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.

Please note that this page is in the process of being updated, so please check back in the next couple days.

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 ev_test:
  • 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