Modifications

Sauter à la navigation Sauter à la recherche
1 498 octets ajoutés ,  15 août 2016 à 16:00
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{RASP-PYGAME-GUI-NAV}}
 
{{RASP-PYGAME-GUI-NAV}}
 +
 +
{{#Widget:Iframe
 +
|url=https://www.youtube.com/embed/2555IMePGgA
 +
|width=420
 +
|height=315
 +
|border=0
 +
}}
 +
 +
 +
Vous devez suivre les instructions d'installation du PiTFT avant de vous plonger dans ce tutoriel. Faites bien attention à choisir le tutoriel adéquat correspondant à votre écran (affichage avec partie tactile '''résistive''' ou '''capacitive''').
 +
 +
Suivez attentivement les instructions de la section [[RASP-PiTFT-Pygame|Truc et Astuce Pygame - vous aurez besoin de la SDL SDL 1.2!]]
 +
 +
Vous pouvez également obtenir toutes les sources du tutoriel depuis le dépôt git:
 +
 +
<syntaxhighlight lang="bash">
 +
git clone https://github.com/jerbly/tutorials.git
 +
</syntaxhighlight>
 +
 +
Pour tester l'afficheur, vous pouvez exécuter les étapes suivantes dans une console python:
 +
 +
<syntaxhighlight lang="python">
 +
pi@raspberrypi ~ $ sudo python
 +
Python 2.7.3 (default, Mar 18 2014, 05:13:23)
 +
[GCC 4.6.3] on linux2
 +
Type "help", "copyright", "credits" or "license" for more information.
 +
>>> import pygame
 +
>>> import os
 +
>>> os.putenv('SDL_FBDEV', '/dev/fb1')
 +
>>> pygame.init()
 +
(6, 0)
 +
>>> lcd = pygame.display.set_mode((320, 240))
 +
>>> lcd.fill((255,0,0))
 +
<rect(0, 0, 320, 240)>
 +
>>> pygame.display.update()
 +
>>> pygame.mouse.set_visible(False)
 +
1
 +
>>> lcd.fill((0,0,0))
 +
<rect(0, 0, 320, 240)>
 +
>>> pygame.display.update()
 +
</syntaxhighlight>
 +
 +
Vous pouvez également exécuter ce test (avec une attente d'une seconde) depuis le projet pygamelcd :
 +
 +
<syntaxhighlight lang="bash">
 +
sudo python test1.py
 +
</syntaxhighlight>
    
{{RASP-PYGAME-GUI-TRAILER}}
 
{{RASP-PYGAME-GUI-TRAILER}}
29 917

modifications

Menu de navigation