Différences entre versions de « RASP-PiTFT-PLUS-Touch »
Ligne 65 : | Ligne 65 : | ||
== Calibration Manuelle == | == Calibration Manuelle == | ||
− | + | Si vous avez appliqué une rotation à votre écran et que nous devez disposer d'une calibration précise de celui-ci... alors vous devez procéder à une calibration manuelle. | |
− | + | Vous n'aurez besoin de calibrer l'écran qu'une seule fois mais vous êtes libre de recalibrer l'écran autant de fois qu'il vous plaira. Nous commençons la calibration en exécutant le ligne de commande suivante: | |
<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 visibles à l'écran, touchez chaque point comme demandé. Utilisez un "Stylus" si vous avez besoin d'un positionnement précis. N'utilisez rien de métallique, uniquement du plastique! | |
{{ADFImage|RASP-PiTFT-PLUS-Touch-30.png}} | {{ADFImage|RASP-PiTFT-PLUS-Touch-30.png}} | ||
− | {{ambox-stop|text= | + | {{ambox-stop|text=Vous devriez voir 5 cibles en forme de croix durant le processus de calibration. Si vous en voyez moins c'est que l'écran tactile à généré plusieurs signaux "tactile" durant une pression, il sera nécessaire de refaire la calibration.}} |
{{ADFImage|RASP-PiTFT-PLUS-Touch-31.png|640px}} | {{ADFImage|RASP-PiTFT-PLUS-Touch-31.png|640px}} | ||
− | + | Ensuite, vous pouvez exécuter {{fname|1=sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test}} qui vous permet de tester la calibration tactile de l'écran en réalisant un dessin. Recommencez la calibration (éventuellement avec un stylus) si vous trouvez que l'écran n'est pas assez précis! | |
{{ADFImage|RASP-PiTFT-PLUS-Touch-32.png}} | {{ADFImage|RASP-PiTFT-PLUS-Touch-32.png}} |
Version du 13 juillet 2015 à 12:35
Introduction
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 |
Crédit: AdaFruit Industries www.adafruit.com
Configurer l'écran tactile
Maintenant que l'écran fonctionne correctement, nous allons nous attarder sur la partie tactile. Il y a juste un peut de calibration à faire mais cela n'est pas bien compliqué.
Avant de commencer, nous allons faire une règle udev pour l'écran tactile. C'est parce que le nom eventX du périphérique va être beaucoup modifié (recevoir beaucoup d'information) et qu'il sera difficile de se faire une idée sur ce qui sera appelé si vous avez une souris ou un clavier.
Exécutez la commande:
sudo nano /etc/udev/rules.d/95-stmpe.rules
pour créer une nouveau fichier udev et y copier/coller les lignes suivantes:
SUBSYSTEM=="input", ATTRS{name}=="stmpe-ts", ENV{DEVNAME}=="*event*", SYMLINK+="input/touchscreen"
Crédit: AdaFruit Industries www.adafruit.com
Retirer et réinstaller l'écran tactile avec les commandes suivantes
sudo rmmod stmpe_ts; sudo modprobe stmpe_ts
Saisissez ensuite ls -l /dev/input/touchscreen
qui devrait pointer vers eventX où X représente une valeur numérique. Cette valeur numérique est différente pour chanque installation puisque les autres périphériques clavier/souris/USB occuperons également un event slot.
Crédit: AdaFruit Industries www.adafruit.com
Il existes quelques outils que nous pouvons utiliser pour calibrer et et déboguer l'écran tacticle. Installez les paquet de test d'événement (event test) et bibliothèque tactile (touchscreen library) avec la commande
sudo apt-get install evtest tslib libts-bin
Crédit: AdaFruit Industries www.adafruit.com
Maintenant, vous pouvez utiliser des outils tels que sudo evtest /dev/input/touchscreen qui affiche, en temps réel, les événements reportée par l'écran tactile. Pressez sur l'écran tactile pour voie ces différents événements.
Crédit: AdaFruit Industries www.adafruit.com
Crédit: AdaFruit Industries www.adafruit.com
Script de calibration automatique
Si vous faire une rotation de l'écran, vous aurez besoin de recalibrer la partie tactile pour qu'elle fonctionne avec la nouvelle orientation. Vous pouvez exécuter manuellement le processus de calibration (voir section suivante) ou vous pouvez exécuter un petit script python qui initialise automatiquement les paramètres de calibration en fonction de l'orientation de l'écran.
Executez la ligne de commande sudo adafruit-pitft-touch-cal
Le script essaye de détecter l'écran installé et l'état du paramètre de rotation
Crédit: AdaFruit Industries www.adafruit.com
Par défaut, le script essaye d'obtenir l'orientation de l'écran en examinant la configuration du module PiTFT avec modprobe. Si le script peut lire l'orientation alors il l'affichera à l'écran, ainsi que les valeurs de calibration actuelles et les nouvelles valeurs de calibration basée sur l'orientation effective de l'écran. Pressez "y" (oui) et le retour-claver (enter) pour confirmer.
Crédit: AdaFruit Industries www.adafruit.com
Essayez d'utiliser le script de calibration par défaut pour facilement calibrer votre afficheur tactile. Notez que les valeurs de calibration pourraient ne pas être les valeurs correspondant exactement à votre écran (tous les écrans sont sensiblement différents) mais elles devraient être suffisamment proche pour répondre à la plupart des besoins courants. Si vous avez besoin d'une calibration tactile plus précise, suivez les étapes de la prochaine section afin de calibrer manuellement votre écran tactile.
Calibration Manuelle
Si vous avez appliqué une rotation à votre écran et que nous devez disposer d'une calibration précise de celui-ci... alors vous devez procéder à une calibration manuelle.
Vous n'aurez besoin de calibrer l'écran qu'une seule fois mais vous êtes libre de recalibrer l'écran autant de fois qu'il vous plaira. Nous commençons la calibration en exécutant le ligne de commande suivante:
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
Suivez les instructions visibles à l'écran, touchez chaque point comme demandé. Utilisez un "Stylus" si vous avez besoin d'un positionnement précis. N'utilisez rien de métallique, uniquement du plastique!
Crédit: AdaFruit Industries www.adafruit.com
Vous devriez voir 5 cibles en forme de croix durant le processus de calibration. Si vous en voyez moins c'est que l'écran tactile à généré plusieurs signaux "tactile" durant une pression, il sera nécessaire de refaire la calibration. |
Crédit: AdaFruit Industries www.adafruit.com
Ensuite, vous pouvez exécuter sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_test qui vous permet de tester la calibration tactile de l'écran en réalisant un dessin. Recommencez la calibration (éventuellement avec un stylus) si vous trouvez que l'écran n'est pas assez précis!
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 (which is challenging to do on such a small screen) OR you can do what we do which is run startx in a SSH/Terminal shell and then run the xinput_calibrator from the same shell, 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
Une fois complété, vous obtenez quelque-chose comme:
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 Control-C to quit.
Depending on the 'rotation' of the screen, when you do this calibration, you may need to comment out the SwapAxes part with a # and/or swap the numbers around so looks like:
Option "Calibration" "119 3736 3850 174"
to
Option "Calibration" "3736 119 174 3850"
Your touchscreen is now super calibrated, hurrah!
Source: Adafruit PiTFT 3.5" Touch Screen for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.
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