RASP-PiTFT-Soft-Install
Introduction
Crédit: AdaFruit Industries www.adafruit.com
In order to add support for the 2.8" TFT and touchscreen, we'll need to install a new Linux Kernel. Lucky for you, we created a kernel package that you can simply install over your current Raspbian (or Raspbian-derived) install instead of needing a whole new image. This makes it easier to keep your install up-to-date.
To use our kernel .deb files you must be using Raspbian or derivative. This wont work with Arch or other Linux flavors. As Raspbian is the official OS for the Pi, that's the only Linux we will support! Others can recompile their own kernel using our patchfile, but we have no tutorial or support or plans for such.
Avant de commencer
You'll need a working install of Raspbian with network access. If you need help getting that far, check out our collection of Pi tutorials.
We'll be doing this from a console cable connection, but you can just as easily do it from the direct HDMI/TV console or by SSH'ing in. Whatever gets you to a shell will work!
Also, run sudo apt-get update !
Téléchargement et installation
Download the multiple files you'll need by running the following commands:
cd ~ wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-112613.deb
480px
Crédit: AdaFruit Industries www.adafruit.com
Next install the new kernel with
sudo dpkg -i -B *.deb
This will take a few minutes so go make a sandwich or coffee
480px
Crédit: AdaFruit Industries www.adafruit.com
480px
Crédit: AdaFruit Industries www.adafruit.com
Now we'll just reboot to let it all sink in.
If you don't have the TFT installed, shutdown, place the TFT on the Pi and re-power
sudo shutdown -h now
else (if you have the TFT plate installed already)
sudo reboot
Now that you're rebooted, log back in on the console/TV/SSH. There's no screen yet, we'll do a test to make sure everything is perfect first!
Run the following commands to install the screen driver. Note that the screen will go from white to black indicating the commands succeeded.
sudo modprobe spi-bcm2708 sudo modprobe fbtft_device name=adafruitts rotate=90 export FRAMEBUFFER=/dev/fb1 startx
480px
Crédit: AdaFruit Industries www.adafruit.com
You should see the Pi desktop show up on the TFT! Congrats, you've completed the first test perfectly. Now we'll make the TFT kernel modules automatically install on boot.
Hit Control-C in the console to quit the X server so we can continue configuration
Auto-chargement du module
We'll now make the modules auto-load. Lets edit the /etc/modules list with
sudo nano /etc/modules
add two lines
spi-bcm2708 fbtft_device
Then Control-X Y [return] to save
480px
Crédit: AdaFruit Industries www.adafruit.com
You're not done yet! Now we have to add the configuration details in a new modprobe file:
sudo nano /etc/modprobe.d/adafruit.conf
add the following line
options fbtft_device name=adafruitts rotate=90 frequency=32000000
and save like you did before.
The rotate= variable tells the driver to rotate the screen 0 90 180 or 270 degrees. 0 is portrait, with the bottom near the "Adafruit Logo" 90 is landscape, with the bottom of the screen near the buttons. 180 is portrait, with the top near the "Adafruit Logo" 270 is landscape, with the top of the screen near the buttons. You can change this file with nano and reboot to make the change stick.
The frequency= variable tells the driver how to fast to drive the display. 32MHz (32000000) is a pretty nice 20 FPS rate but if your screen is acting funny, try taking it down to 16MHz (16000000)
480px
Crédit: AdaFruit Industries www.adafruit.com
sudo reboot and look at the console output (or run dmesg in the console window after logging in) you will see the modules install. Look in particular for the STMPE610 detection and the ILI9340 screen frequency as highlighted here
480px
Crédit: AdaFruit Industries www.adafruit.com
We can set up the touchscreen for rotate=90 configuration by doing the following (for more delicate calibration or for other rotate=XX values, see the next section) Create the directory and new calibration configuration file:
sudo mkdir /etc/X11/xorg.conf.d sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
and enter in the following lines, then save.
Section "InputClass" Identifier "calibration" MatchProduct "stmpe-ts" Option "Calibration" "3800 200 200 3800" Option "SwapAxes" "1" EndSection
480px
Crédit: AdaFruit Industries www.adafruit.com
You can now try to run X again with
FRAMEBUFFER=/dev/fb1 startx
Type Control-C to quit X
If you don't ever want to have to type FRAMEBUFFER=/dev/fb1 before startx, you can make it a default state by editing your profile file: sudo nano ~/.profile and adding
export FRAMEBUFFER=/dev/fb1
near the top and saving the file. If you log out or reboot it will be in place from then on.
480px
Crédit: AdaFruit Industries www.adafruit.com
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