issue118:python
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue118:python [2017/02/28 11:07] – créée auntiee | issue118:python [2017/03/08 08:01] (Version actuelle) – d52fr | ||
---|---|---|---|
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:// | + | **Before we get too far along, there is a new version of the Arduino IDE (1.8.0) available at https:// |
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' |
+ | |||
+ | 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' | ||
+ | • Une plaque d' | ||
+ | • Des cavaliers. | ||
+ | • Un potentiomètre de 10 kΩ. | ||
+ | |||
+ | **Wiring | ||
Once again, for our first two projects, we’ll use the same wiring/ | Once again, for our first two projects, we’ll use the same wiring/ | ||
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/ | ||
+ | |||
+ | 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' | ||
+ | |||
+ | 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, | Again, pull up the code in the IDE, upload it to your Arduino, and when you turn 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, | ||
+ | |||
+ | Comme j'ai déjà dit plus tôt, le mois prochain, nous utiliserons le Raspberry Pi pour contrôler l' |
issue118/python.txt · Dernière modification : 2017/03/08 08:01 de d52fr