issue111:python
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue111:python [2016/08/20 14:27] – d52fr | issue111:python [2016/08/24 11:18] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 10: | Ligne 10: | ||
Le mois dernier, nous avons travaillé avec le capteur de température DS18B20. Ce mois-ci, nous commencerons par interfacer un afficheur LCD 16x2 pour montrer nos températures. Ne défaites pas votre montage, mais assurez-vous que vous avez assez de place pour monter votre afficheur sur la plaque d' | Le mois dernier, nous avons travaillé avec le capteur de température DS18B20. Ce mois-ci, nous commencerons par interfacer un afficheur LCD 16x2 pour montrer nos températures. Ne défaites pas votre montage, mais assurez-vous que vous avez assez de place pour monter votre afficheur sur la plaque d' | ||
- | Bien sûr, l' | + | Bien sûr, l' |
Nous ferons 8 connexions au RPi, en plus des trois que nous utilisions le mois dernier pour le capteur de température. Ce mois-ci, nous aurons besoin des composants supplémentaires suivants : | Nous ferons 8 connexions au RPi, en plus des trois que nous utilisions le mois dernier pour le capteur de température. Ce mois-ci, nous aurons besoin des composants supplémentaires suivants : | ||
- | • un potentiomètre de 10k | + | • un potentiomètre de 10k ; |
- | • un afficheur LCD 16x2 | + | • un afficheur LCD 16x2 ; |
- | • de nombreux cavaliers pour la plaque d' | + | • de nombreux cavaliers pour la plaque d' |
**By the time you are done, the wiring diagram (and the resulting board) will look like a bit of a rat’s nest, but go slowly – make sure you have the wiring correct. | **By the time you are done, the wiring diagram (and the resulting board) will look like a bit of a rat’s nest, but go slowly – make sure you have the wiring correct. | ||
Ligne 25: | Ligne 25: | ||
On the display, connect pin 1 to ground and pin 2 to the +5 volt buss. That makes three connections out of the twelve we need. Pin 6 of the display goes to pin 22 of the RPi. This is the Enable pin. Pin 5 on the display goes to ground, and pin 4 to pin 27 on the RPi. We are up to 6 connections so far. That makes us halfway there. Because we have to use pin 4 for our sensor, we can’t control the backlight.** | On the display, connect pin 1 to ground and pin 2 to the +5 volt buss. That makes three connections out of the twelve we need. Pin 6 of the display goes to pin 22 of the RPi. This is the Enable pin. Pin 5 on the display goes to ground, and pin 4 to pin 27 on the RPi. We are up to 6 connections so far. That makes us halfway there. Because we have to use pin 4 for our sensor, we can’t control the backlight.** | ||
- | Une fois que vous l'avez fait, le schéma de câblage (et en vrai sur la plaque) | + | Une fois terminé, le schéma de câblage (et en vrai sur la plaque) |
- | Comme vous pouvez le voir sur le schéma | + | Comme vous pouvez le voir sur le schéma |
- | D' | + | D' |
- | Sur l' | + | Sur l' |
**Now we will work backwards from pin 16. Pin 16 goes to ground, and pin 15 to +5v. Pin 15 is actually the backlight voltage on mine. If you find the display too bright, you could put the wiper of another potentiometer connected between +5v and ground and control the display backlight. | **Now we will work backwards from pin 16. Pin 16 goes to ground, and pin 15 to +5v. Pin 15 is actually the backlight voltage on mine. If you find the display too bright, you could put the wiper of another potentiometer connected between +5v and ground and control the display backlight. | ||
Ligne 47: | Ligne 47: | ||
cd examples** | cd examples** | ||
- | Maintenant, | + | Maintenant, |
- | Maintenant, | + | Maintenant, les lignes de données. Il y a réellement 8 lignes de données, mais, heureusement, |
- | Maintenant tout est connecté | + | Maintenant tout est connecté |
git clone https:// | git clone https:// | ||
Ligne 78: | Ligne 78: | ||
That’s about it for this month. Next month we will look at changing out our regular 16x2 display for a 16x2 I2C display (which uses only 2 lines for data and all control, and 2 lines for power.) We will also discuss the different ways of using serial communication for interfacing displays and other devices. Until then, have fun!** | That’s about it for this month. Next month we will look at changing out our regular 16x2 display for a 16x2 I2C display (which uses only 2 lines for data and all control, and 2 lines for power.) We will also discuss the different ways of using serial communication for interfacing displays and other devices. Until then, have fun!** | ||
- | Maintenant, chargez char_lcd.py dans votre éditeur favori. Ou, vous pouvez | + | Maintenant, chargez char_lcd.py dans votre éditeur favori. Ou vous pouvez |
- | Ignorez les messages de rétro-éclairage ; mais vous devriez | + | Ignorez les messages de rétro-éclairage ; mais vous devrez |
- | Hello World! | + | Hello World! |
- | Show Cursor_ | + | Show Cursor_ |
- | Blink Cursor_ | + | Blink Cursor_ |
- | Scroll (right and left) | + | Scroll (right and left) (déplacement, |
- | Flash backlight in 5 seconds... | + | Flash backlight in 5 seconds... |
- | Goodbye! | + | Goodbye! |
Si tout a bien fonctionné, | Si tout a bien fonctionné, | ||
+ | |||
+ | Voici le programme du mois dernier, modifié, qui inclut des bribes de code venant de cet exemple (en haut à droite) d' | ||
+ | |||
+ | C'est tout pour cette fois. Le mois prochain, nous examinerons le remplacement de notre afficheur 16x2 classique par un afficheur IC2 16x2 (qui n' | ||
issue111/python.1471696065.txt.gz · Dernière modification : 2016/08/20 14:27 de d52fr