Pololu-Romi-32U4-Programmer-Arduino-IDE

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche

Programmer en utilisant Arduino IDE

La famille des cartes à base de 32U4 peut être programmée avec le populaire environnement de programmation Arduino IDE. Arduino IDE est un environnement open-source cross-platform qui intègre un éditeur de code C++, le compilateur GNU C++ et un utilitaire de téléversement (AVRDUDE).

Pour débuter rapidement la programmation de votre périphérique avec Arduino IDE (version 1.6.4 ou suivant), en suivant les étapes suivantes:

Téléchargez Arduino IDE depuis la page de télécharge d'Arduino, installez le et démarrez le.

1. Ouvrez le menu "Fichier" dans Arduino IDE (sous Windows/Linux sinon c'est le menu Arduino sous macOS) puis sélectionnez l'entrée "Preferences”.

2. Dans la boîte de dialogue des préférences, localisez la boîte d'édition libellée "Additional Boards Manager URLs" (URL de gestionnaire de cartes supplémentaires) comme indiqué sur la capture d'écran ci-dessous. Copiez et collez l'URL suivante dans la zone de texte:

https://files.pololu.com/arduino/package_pololu_index.json

S'il y a d'autre URLs déjà présentes alors il faut utiliser une virgule comme séparateur avant d'ajouter une nouvelle URL (cliquer sur le bouton à côté de la zone de texte permet d'ajouter l'URL sur une nouvelle ligne).

Pololu-Romi-32U4-Programmer-Arduino-IDE-01.png

3. Cliquez sur "OK" pour fermer la boîte de dialogue des préférences.

4. Dans le menu Outils > Type de carte, sélectionner l'entrée "gestionnaire de carte..." (Boards Manager) tout en haut du menu.

5. In the Boards Manager dialog, search for “Pololu A-Star Boards”.

6. Select the “Pololu A-Star Boards” entry in the list, and click the “Install” button.

7. After the installation finishes, click the “Close” button to close the Boards Manager dialog.

8. In the Tools > Board menu, select the “Pololu A-Star 32U4” entry. If you do not see your device listed in the Board menu, try restarting the Arduino IDE.


Pololu-Romi-32U4-Programmer-Arduino-IDE-02.png

9. In the Tools > Port menu, select the port for the device. On Windows you can determine what COM port the device is assigned to by looking at the “Ports (COM & LPT)” section of the Device Manager. On Linux, the port name will begin with “/dev/ttyACM”. On Mac OS X, the port name will begin with “/dev/tty.usbmodem”.

Pololu-Romi-32U4-Programmer-Arduino-IDE-03.png

10. Open up the “Blink” Arduino example, which can be found under File > Examples > 01.Basics > Blink. The code in this example will blink the yellow LED. When you select the Blink example, a new Arduino IDE window will open up. It is OK to close the first window.

Pololu-Romi-32U4-Programmer-Arduino-IDE-04.png

11. Press the “Upload” button to compile the sketch and upload it to the device. If everything goes correctly, you will see the message “Done uploading” appear near the bottom of the window. If you are using Windows and you have not previously programmed an A-Star device on this USB port, then Windows might take several seconds to recognize the A-Star bootloader. The bootloader times out after 8 seconds and goes back to running the sketch, so the upload might fail if Windows does not recognize it quickly enough. If this happens, try again. If you are using Windows XP and have not programmed an A-Star on this USB port, you will have to go through the Found New Hardware Wizard again as described in the previous section, but the second time you try to upload it should work. If the Arduino IDE has trouble connecting to the port or using it, try unplugging the device, closing any programs that might be using the serial port, restarting the Arduino IDE, and then plugging the device back in.

Pololu-Romi-32U4-Programmer-Arduino-IDE-05.png

12. f you uploaded the Blink sketch, then the yellow LED should be blinking once every two seconds. However, we ship some A-Stars with that same example already programmed onto it, so you might not be convinced that anything has changed. Try changing the delay values in the sketch to something else and uploading again to see if you can change the speed of the LED.

After you succeed in programming your device from the Arduino IDE, there are many resources you can use to learn more:

  • The Arduino IDE has many examples that can run on A-Stars.
  • The Arduino website has a Language Reference, a wiki called the The Arduino Playground, and other resources.
  • The A-Star 32U4 boards are similar to the Arduino Leonardo and Arduino Micro, so you can search the Internet for relevant projects that use one of those boards.
  • The Related Resources section lists many more resources.

Basé sur "Guide utilisateur de la carte de contrôle Romi 32U4" de Pololu (https://www.pololu.com/docs/0J69) - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction". Traduit avec l'autorisation expresse de Pololu (www.pololu.com)

Based on "Pololu Romi 32U4 Control Board User’s Guide" from Pololu (https://www.pololu.com/docs/0J69) - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit). Translated with the Pololu's authorization (www.pololu.com)