Outils pour utilisateurs

Outils du site


issue118:python

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
issue118:python [2017/02/28 11:07] – créée auntieeissue118:python [2017/03/07 11:55] andre_domenech
Ligne 1: Ligne 1:
-Before we get too far along, there is a new version of the Arduino IDE (1.8.0) available at https://www.arduino.cc/en/Main/Software#/?, so it would be a good idea if you download and install it before continuing. If you aren’t using your RPi for your Arduino programming, go ahead and dust it off and install the new Arduino IDE on it so you’ll be ready for next month.+**Before we get too far along, there is a new version of the Arduino IDE (1.8.0) available at https://www.arduino.cc/en/Main/Software#/?, so it would be a good idea if you download and install it before continuing. If you aren’t using your RPi for your Arduino programming, go ahead and dust it off and install the new Arduino IDE on it so you’ll be ready for next month.
  
 This month, we’ll be controlling the Servo motor we used a few months ago on the RPi. This month, we’ll be controlling the Servo motor we used a few months ago on the RPi.
Ligne 10: Ligne 10:
 • Breadboard  • Breadboard 
 • Jumpers • Jumpers
-• 10K Potentiometer+• 10K Potentiometer**
  
-Wiring+Avant d'aller trop loin, il y a une nouvelle version de l'IDE Arduino (la 1.8.0), qui est disponible à https://www.arduino.cc/en/Main/Software#/? ; ce serait une bonne idée de la télécharger et l'installer avant de continuer. Si vous n'utilisez pas votre RPi pour la programmation d'Arduino, allez-y, dépoussiérez-le et installez-y le nouvel IDE Arduino afin d'être prêt pour le mois prochain. 
 + 
 +Ce mois-ci, nous contrôlerons le servomoteur que nous avons utilisé sur le RPi il y a quelques mois. 
 + 
 +Le matériel 
 + 
 +Le matériel dont nous aurons besoin cette fois-ci est très simple et vous devriez déjà tout avoir : 
 +• Un servomoteur DC de 5V. 
 +• L'Arduino Uno (ou clone). 
 +• Une plaque d'essais. 
 +• Des cavaliers. 
 +• Un potentiomètre de 10 K. 
 + 
 +**Wiring
  
 Once again, for our first two projects, we’ll use the same wiring/breadboard setup – even though the potentiometer is not used in the sweep program. Once again, for our first two projects, we’ll use the same wiring/breadboard setup – even though the potentiometer is not used in the sweep program.
Ligne 22: Ligne 35:
 This sample code (next page, top right), and the next sample, are from the Arduino IDE Examples, so you really won’t need to copy the code. Just open the IDE, Select File | Examples | Servo. and the Sweep code. The code is already well documented, so we won’t need to discuss much about it. This sample code (next page, top right), and the next sample, are from the Arduino IDE Examples, so you really won’t need to copy the code. Just open the IDE, Select File | Examples | Servo. and the Sweep code. The code is already well documented, so we won’t need to discuss much about it.
  
-Plug in your Arduino, upload the code to it, and you’ll see that the servo starts sweeping back and forth.+Plug in your Arduino, upload the code to it, and you’ll see that the servo starts sweeping back and forth.**
  
-Knob+Câblage 
 + 
 +À nouveau, pour les deux premiers projets, nous utiliserons la même configuration câblage/plaque à essais, bien que le potentiomètre ne s'utilise pas dans le programme de balayage. 
 + 
 +Pour ceux que cela intéresse, voici le schéma : 
 + 
 +Balayage 
 + 
 +Je tiens ce code échantillon (en haut à droite de la page suivante) ainsi que le suivant, des Arduino IDE Examples sur le site d'Arduino et vous n'aurez donc pas besoin de le copier. Il suffit d'ouvrir l'IDE, Select File (Sélectionner un fichier) | Examples | Servo. et le code « Sweep » (Balayage). Puisque le code est déjà très bien documenté, nous n'aurons pas besoin d'en parler beaucoup. 
 + 
 +Branchez votre Arduino, téléversez le code dessus et vous verrez que le servomoteur commence à balayer de gauche à droite et de droite à gauche. 
 + 
 +**Knob
  
 Just as in the sweep program, the example code is found in the Arduino IDE under File | Examples | Servo | Knob. And again, the code is very well documented already, so no major discussion will be needed. Just as in the sweep program, the example code is found in the Arduino IDE under File | Examples | Servo | Knob. And again, the code is very well documented already, so no major discussion will be needed.
Ligne 30: Ligne 55:
 Again, pull up the code in the IDE, upload it to your Arduino, and when you turn the potentiometer, you should see the servo swing in response to the position of the potentiometer. Again, pull up the code in the IDE, upload it to your Arduino, and when you turn the potentiometer, you should see the servo swing in response to the position of the potentiometer.
  
-As I said earlier, next month we will be working with the Raspberry Pi to control the Arduino, so break it back out, and get ready.+As I said earlier, next month we will be working with the Raspberry Pi to control the Arduino, so break it back out, and get ready.** 
 + 
 +Bouton 
 + 
 +Tout comme pour le programme sweep, le code se trouve dans l'IDE Arduino sous File | Examples | Servo | Knob (bouton). Et, à nouveau, le code est déjà très bien documenté et une discussion importante à son sujet serait superflue. 
 + 
 +À nouveau, récupérez le code dans l'iDE, téléversez-le sur votre Arduino et, quand vous tournerez le potentiomètre, vous verrez que le servomoteur commence à balayer en réponse à la position du potentiomètre. 
 + 
 +Comme j'ai déjà dit plus tôt, le mois prochain, nous utiliserons le Raspberry Pi pour contrôler l'Arduino, alors recherchez-le et tenez-vous prêt.
issue118/python.txt · Dernière modification : 2017/03/08 08:01 de d52fr