Capacitive Touchscreen Configuration

If you've grabbed our Easy Install image, or use the script, this step is not required, it's already done! This is just for advanced users who are curious on how to configure and customize the touchscreen

The nifty thing about capacitive touch screens is that they do not require calibration! The calibration is done 'in chip' on the screen itself. However, we still do need to tell the Pi how to read the capacitive chip.

Before we start, we'll make a udev rule for the touchscreen. That's because the eventX name of the device will change a lot and its annoying to figure out what its called depending on whether you have a keyboard or other mouse installed.

First up figure out if you have the FT62X6 driver or FT6236 driver by running dmesg | grep ft6

 

If you are running FT6236 driver

Run

sudo nano /etc/udev/rules.d/95-ft6236.rules

to create a new udev file and copy & paste the following line in:

SUBSYSTEM=="input", ATTRS{name}=="ft6236", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"

If you are running FT6X06 driver

Run

sudo nano /etc/udev/rules.d/95-ft6206.rules

to create a new udev file and copy & paste the following line in:

SUBSYSTEM=="input", ATTRS{name}=="ft6x06_ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"

Reboot the Pi with sudo reboot

Then type ls -l /dev/input/touchscreen
It should point to eventX where X is some number, that number will be different on different setups since other keyboards/mice/USB devices will take up an event slot

Event Testing

Even though capacitive touch screens don't require calibration, there are some useful tools we can use to debug the touchscreen. Install the "event test" and "touchscreen library" packages with

sudo apt-get install evtest tslib libts-bin

Now you can use some tools such as

sudo evtest /dev/input/touchscreen

which will let you see touchscreen events in real time, press on the touchscreen to see the reports.

AutoMagic Calibration Script

If you rotate the display you need to recalibrate the touchscreen to work with the new screen orientation. You can manually run the calibration processes in the next section, or you can re-run the installer script and select a new rotation:

Try using this default calibration script to easily calibrate your touchscreen display. Note that the calibration values might not be exactly right for your display, but they should be close enough for most needs. If you need the most accurate touchscreen calibration, follow the steps in the next section to manually calibrate the touchscreen.

TSLIB calibration

In order to use TSLIB - basically, the touchscreen without X11 - you'll need to set the calibration for TSLIB in /etc/pointercal

With a resistive touchscreen, you have to calibrate it. Since capacitive touchscreens don't require calibration you can just input the numbers directly. Run
sudo nano /etc/pointercal
And enter in the following values (there's a single space between each number) and hit return afterwards. Then save
320 65536 0 -65536 0 15728640 65536

Next you can run

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test

X11 Calibration

X11 uses a different calibration system than TSLib/PyGame. You can see how to run xtcal here except use EP0110M09 as the name of the device

Last updated on Mar 29, 2018 Published on Jul 21, 2014