Ligne 1 : |
Ligne 1 : |
| {{RASP-PiOLED-NAV}} | | {{RASP-PiOLED-NAV}} |
− |
| |
− | {{traduction}}
| |
| | | |
| == Introduction == | | == Introduction == |
Ligne 241 : |
Ligne 239 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | {{traduction}} | + | En utilisant la classe subprocess, python peut utiliser des commandes Linux pour accéder aux informations systèmes du Pi. La boucle {{fname|while}} effectue un rafraîchissement de l'écran 10 fois par seconde. |
| | | |
− | Using the subprocess class, python can utilize linux commands to access the Pi's system information. This loop updates the screen at 10 times a second.<br><br>That's all there is to the '''stats.py''' code!
| + | Voilà, c'est tout en ce qui concerne le code de '''stats.py''' ! |
| | | |
− | == More Demos & Examples == | + | == Plus d'exemples == |
− | You can check out our other examples in the example, just make sure to edit each one with '''nano animate.py''' for example, and find the line that says:
| + | Vous pouvez consulter les autres exemples du sous-répertoire {{fname|examples}}. |
| + | |
| + | Assurez-vous d'éditer chacun des exemples (avec '''nano animate.py''' par exemple) et trouvez la ligne mentionnant: |
| | | |
| <syntaxhighlight lang="python"> | | <syntaxhighlight lang="python"> |
Ligne 253 : |
Ligne 253 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | and change it to:
| + | et la changer en : |
| | | |
| <syntaxhighlight lang="python"> | | <syntaxhighlight lang="python"> |
| # Raspberry Pi pin configuration: | | # Raspberry Pi pin configuration: |
− | RST = None # PiOLED does not require reset pin | + | RST = None # PiOLED n'a pas besoin de la broche Reset |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | and make sure that the configuration section where you choose which type of display, looks like this
| + | puis assurez vous que la configuration section utilise la déclaration correspond à votre afficheur PiOled... comme ceci: |
| | | |
| <syntaxhighlight lang="python"> | | <syntaxhighlight lang="python"> |
Ligne 276 : |
Ligne 276 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | That is, we'll be using I2C 128x32 display!
| + | Voila, le script d'exemple utilise maintenant un afficheur I2C 128x32 pixels (sans broche Reset)! |
| | | |
− | == Speeding Up the Display == | + | == Améliorer la vitesse de l'afficheur == |
− | For the best performance, especially if you are doing fast animations, you'll want to tweak the I2C core to run at 1MHz. By default it may be 100KHz or 400KHz
| + | Pour de meilleures performances, plus spécialement si vous avez besoin d'animation rapide, vous pouvez optimiser le fonctionnement du bus I2C pour qu'il fonctionne 1MHz. En effet, le bus est configuré à la fréquence 100KHz ou 400KHz |
| | | |
− | To do this edit the config with '''sudo nano /boot/config.txt'''
| + | Pour modifier la vitesse du bus, éditez le fichier de configuration avec '''sudo nano /boot/config.txt''' |
| | | |
− | and add to the end of the file
| + | et ajoutez la ligne suivante à la fin du fichier |
| | | |
− | '''dtparam=i2c_baudrate=1000000'''
| + | <syntaxhighlight lang="python"> |
| + | dtparam=i2c_baudrate=1000000 |
| + | </syntaxhighlight> |
| | | |
| {{ADFImage|RASP-PiOLED-Utiliser-06.png|640px}} | | {{ADFImage|RASP-PiOLED-Utiliser-06.png|640px}} |
| | | |
− | reboot to 'set' the change.
| + | Redémarrer le Pi pour appliquer les modifications. |
− | | |
| | | |
| {{RASP-PiOLED-TRAILER}} | | {{RASP-PiOLED-TRAILER}} |