Différences entre versions de « RASP-PiTFT-Touch »
Ligne 10 : | Ligne 10 : | ||
== Configurer la partie tactile == | == Configurer la partie tactile == | ||
− | + | Maintenant que nous avons un écran qui fonctionne correctement, nous allons pouvoir nous pencher sur la partie tactile. Il y a un peu de calibration à réaliser mais ce n'est vraiment pas difficile. | |
− | + | Avant de commencer, nous allons créer une règle '''udev''' pour l'écran tactile (''touchscreen'' en anglais). C'est parce que le nom du périphérique '''eventX''' change de façon importante et qu'il est ennuyant de deviner ce qu'il est appelé en fonction du matériel installé (clavier ou souris). | |
− | + | Exécutez | |
<nowiki>sudo nano /etc/udev/rules.d/95-stmpe.rules</nowiki> | <nowiki>sudo nano /etc/udev/rules.d/95-stmpe.rules</nowiki> | ||
− | + | pour créer un nouveau fichier '''udev''' et copiez/collez la ligne suivante dedans: | |
<nowiki>SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"</nowiki> | <nowiki>SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"</nowiki> | ||
Ligne 24 : | Ligne 24 : | ||
{{ADFImage|RASP-PiTFT-Soft-Touch-01.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-01.png|480px}} | ||
− | + | Désactivez et re-installez l'écran tactile à l'aide de | |
<nowiki>sudo rmmod stmpe_ts; sudo modprobe stmpe_ts</nowiki> | <nowiki>sudo rmmod stmpe_ts; sudo modprobe stmpe_ts</nowiki> | ||
− | + | Tapez ensuite '''ls -l /dev/input touchscreen''' | |
− | + | Il devrait pointer vers '''eventX''' où X représente un nombre, ce nombre varie d'une installation à l'autre et dépend du nombre de périphériques installés (clavier/souris/usb) et utilisant eux aussi des "entrée" d’évènement (''event slot''). | |
{{ADFImage|RASP-PiTFT-Soft-Touch-02.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-02.png|480px}} | ||
− | + | Il existe quelques outils permettant de calibrer et déboguer des écrans tactiles. Installez les paquets de "test d’évènement" et "bibliothèque tactile" à l'aide de: | |
<nowiki>sudo apt-get install evtest tslib libts-bin</nowiki> | <nowiki>sudo apt-get install evtest tslib libts-bin</nowiki> | ||
Ligne 40 : | Ligne 40 : | ||
{{ADFImage|RASP-PiTFT-Soft-Touch-03.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-03.png|480px}} | ||
− | + | Vous disposer maintenant de quelques outils comme '''sudo evtest /dev/input/touchscreen''' vous permettant de voir les évènement tactiles en temps réel. Touchez votre écran pour voir les informations retournées par evtest. | |
{{ADFImage|RASP-PiTFT-Soft-Touch-04a.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-04a.png|480px}} | ||
Ligne 46 : | Ligne 46 : | ||
{{ADFImage|RASP-PiTFT-Soft-Touch-04b.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-04b.png|480px}} | ||
− | OK | + | OK commençons maintenant le processus de calibration! Vous n'aurez besoin d'effectuer cette tâche qu'une seule fois. |
+ | |||
+ | Tapez la commande suivante pour commencer la calibration | ||
<nowiki>sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate</nowiki> | <nowiki>sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate</nowiki> | ||
− | + | Suivez les instructions affichées sur l'écran en touchant chaque point. Utiliser un stylet pour disposer d'une plus grande précision. <font color="red">N'utilisez surtout pas du métal, uniquement du plastique!</font> | |
{{ADFImage|RASP-PiTFT-Soft-Touch-05a.png}} | {{ADFImage|RASP-PiTFT-Soft-Touch-05a.png}} | ||
Ligne 56 : | Ligne 58 : | ||
{{ADFImage|RASP-PiTFT-Soft-Touch-05b.png|480px}} | {{ADFImage|RASP-PiTFT-Soft-Touch-05b.png|480px}} | ||
− | + | Vous pouvez ensuite exécuter la commande | |
+ | '''sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test''' | ||
+ | qui vous permettra de réaliser un test graphique en réalisant un dessin avec l'écran tactile. | ||
+ | |||
+ | Vous pouvez redémarrer la phase de calibration si vous trouvez que la précision de l'écran est insuffisante. | ||
{{ADFImage|RASP-PiTFT-Soft-Touch-06.png}} | {{ADFImage|RASP-PiTFT-Soft-Touch-06.png}} |
Version du 16 décembre 2013 à 16:22
Présentation
Crédit: AdaFruit Industries www.adafruit.com
L'écran PiTFT est équipé d'un film résistif, ce qui permet de simuler le fonctionnement de la souris en touchant l'écran.
Il convient néanmoins d'installer le support logiciel nécessaire (pour bouger le pointeur de souris) et d'effectuer une calibration.
Configurer la partie tactile
Maintenant que nous avons un écran qui fonctionne correctement, nous allons pouvoir nous pencher sur la partie tactile. Il y a un peu de calibration à réaliser mais ce n'est vraiment pas difficile.
Avant de commencer, nous allons créer une règle udev pour l'écran tactile (touchscreen en anglais). C'est parce que le nom du périphérique eventX change de façon importante et qu'il est ennuyant de deviner ce qu'il est appelé en fonction du matériel installé (clavier ou souris).
Exécutez
sudo nano /etc/udev/rules.d/95-stmpe.rules
pour créer un nouveau fichier udev et copiez/collez la ligne suivante dedans:
SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"
Crédit: AdaFruit Industries www.adafruit.com
Désactivez et re-installez l'écran tactile à l'aide de
sudo rmmod stmpe_ts; sudo modprobe stmpe_ts
Tapez ensuite ls -l /dev/input touchscreen
Il devrait pointer vers eventX où X représente un nombre, ce nombre varie d'une installation à l'autre et dépend du nombre de périphériques installés (clavier/souris/usb) et utilisant eux aussi des "entrée" d’évènement (event slot).
Crédit: AdaFruit Industries www.adafruit.com
Il existe quelques outils permettant de calibrer et déboguer des écrans tactiles. Installez les paquets de "test d’évènement" et "bibliothèque tactile" à l'aide de:
sudo apt-get install evtest tslib libts-bin
Crédit: AdaFruit Industries www.adafruit.com
Vous disposer maintenant de quelques outils comme sudo evtest /dev/input/touchscreen vous permettant de voir les évènement tactiles en temps réel. Touchez votre écran pour voir les informations retournées par evtest.
Crédit: AdaFruit Industries www.adafruit.com
Crédit: AdaFruit Industries www.adafruit.com
OK commençons maintenant le processus de calibration! Vous n'aurez besoin d'effectuer cette tâche qu'une seule fois.
Tapez la commande suivante pour commencer la calibration
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
Suivez les instructions affichées sur l'écran en touchant chaque point. Utiliser un stylet pour disposer d'une plus grande précision. N'utilisez surtout pas du métal, uniquement du plastique!
Crédit: AdaFruit Industries www.adafruit.com
Crédit: AdaFruit Industries www.adafruit.com
Vous pouvez ensuite exécuter la commande
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test
qui vous permettra de réaliser un test graphique en réalisant un dessin avec l'écran tactile.
Vous pouvez redémarrer la phase de calibration si vous trouvez que la précision de l'écran est insuffisante.
Crédit: AdaFruit Industries www.adafruit.com
Calibration X
You can also calibrate the X input system but you have to use a different program called xinput_calibrator
You can do this if the calibration on the screen isnt to your liking or any time you change the rotate=XX module settings for the screen. Since the screen and touch driver are completely separated, the touchscreen doesn't auto-rotate
Normally you'd have to compile it but we have a ready to go package for you so run:
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_armhf.deb
Before you start the xinput_calibrator you will need to delete the old calibration data so run
sudo rm /etc/X11/xorg.conf.d/99-calibration.conf
Before running startx and the calibrator - otherwise it gets really confused!
Now you'll have to run the xcalibrator while also running X. You can do this by startx and then opening up the terminal program and running the xinput_calibrator command OR you can do what we do which is run startx in a SSH/Terminal shell and then run the xinput_calibrator in the X window, which requires the following command order:
FRAMEBUFFER=/dev/fb1 startx & DISPLAY=:0.0 xinput_calibrator
Follow the directions on screen
Crédit: AdaFruit Industries www.adafruit.com
Once complete you'll get something like:
Crédit: AdaFruit Industries www.adafruit.com
Run sudo nano /etc/X11/xorg.conf.d/99-calibration.conf and copy the
Section "InputClass" Identifier "calibration" MatchProduct "stmpe-ts" Option "Calibration" "119 3736 3850 174" Option "SwapAxes" "1" EndSection
or whatever you got, into there. You can quit X if you want by typing fg to bring that command into the foreground, and then CONTROLE-C to quit.
Your touchscreen is now super calibrated, hurrah!
Source: Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.
Augmenté par Meurisse D. pour MCHobby
Traduction réalisée par Meurisse D pour MCHobby.be.
Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : « Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.
L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.
Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com