Modifications

Sauter à la navigation Sauter à la recherche
2 762 octets ajoutés ,  13 juillet 2015 à 11:28
Page créée avec « {{RASP-PiTFT-PLUS-NAV}} == Introduction == {{bloc-etroit|text= {{ambox-stop|text=If you've grabbed our Easy Install image, or use the script, this step is not required, it'... »
{{RASP-PiTFT-PLUS-NAV}}

== Introduction ==
{{bloc-etroit|text=

{{ambox-stop|text=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 }}

}}
{{ADFImage|RASP-PiTFT-PLUS-Touch-01.jpg|640px}}

== Configurer l'écran tactile ==
{{bloc-etroit|text=Now that the screen is working nicely, we'll take care of the touchscreen. There's just a bit of calibration to do, but it isn't hard at all.

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.

Run
}}

<nowiki>sudo nano /etc/udev/rules.d/95-stmpe.rules</nowiki>

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

<nowiki>SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"</nowiki>

{{ADFImage|RASP-PiTFT-PLUS-Touch-10.png|640px}}

Remove and re-install the touchscreen with

<nowiki>sudo rmmod stmpe_ts; sudo modprobe stmpe_ts</nowiki>

Then type {{fname|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

{{ADFImage|RASP-PiTFT-PLUS-Touch-11.png|640px}}

There are some tools we can use to calibrate & debug the touchscreen. Install the "event test" and "touchscreen library" packages with

<nowiki>sudo apt-get install evtest tslib libts-bin</nowiki>

{{ADFImage|RASP-PiTFT-PLUS-Touch-12.png|640px}}

Now you can use some tools such as {{fname|sudo evtest /dev/input/touchscreen}} which will let you see touchscreen events in real time, press on the touchscreen to see the reports.

{{ADFImage|RASP-PiTFT-PLUS-Touch-13.png|640px}}

{{ADFImage|RASP-PiTFT-PLUS-Touch-14.png|640px}}

== Script de calibration automatique ==

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 run a small Python script which will automatically set a default touchscreen calibration based on the screen orientation.


[https://raw.githubusercontent.com/adafruit/PiTFT_Extras/master/pitft_touch_cal.py This helper is automatically installed for you but if you'd like you can check it out here on github]

Run it at the command line with {{fname|sudo adafruit-pitft-touch-cal}}

it will try to figure out what display you have installed and the rotation it's set up for

{{ADFImage|RASP-PiTFT-PLUS-Touch-20.png|640px}}

{{RASP-PiTFT-PLUS-TRAILER}}
29 922

modifications

Menu de navigation