Bluefruit-LE-Shield-Brancher

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


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Raccordement par défaut

To make things fast, we attached all the pins required to a default pin out. In order to follow along with the default tutorial wiring, the Bluefruit LE SPI Friend should not be modified and will use the following pins:

Broches SPI du Bluefruit LE Broche Arduino
SCK SPI Matériel: SCK
MISO SPI matériel: MISO
MOSI SPI matériel: MOSI
CS 8
IRQ 7
RST 4

Par défaut, Adafruit utilise le bus SPI matériel. Those pins are shared with other digital pins. For example, it uses the UNO's hardware pins #13, #12 and #11.

If you have an Uno or compatible (Atmega328) with the 2x3 header missing, you can short the jumpers on the bottom of the shield to hard-connect SCK/MISO/MOSI to 13/12/11.

If you don't want to use the 2x3 hardware SPI for some reason, you can always use software SPI, which is a tad slower but can use any 3 pins. Just solder jumper wires from the SCK/MISO/MOSI breakouts to whatever pins you like.

Modifier le brochage par défaut

The examples sketches may use slightly different pins. If you wish to change the location of the CS, IRQ or RST pins, open the BluefruitConfig.h file in the example folder of the example you are using, and change the pin to an appropriate value (See the Software section of this tutorial for instructions on installing the library):

#define BLUEFRUIT_SPI_CS               8
#define BLUEFRUIT_SPI_IRQ              7
#define BLUEFRUIT_SPI_RST              4

If you want to use software (bitbang) SPI, you can change the SCK, MISO and MOSI pins using the following macros in the same file:

#define BLUEFRUIT_SPI_SCK              13
#define BLUEFRUIT_SPI_MISO             12
#define BLUEFRUIT_SPI_MOSI             11

The BluefruitConfig.h file can be found in a dedicated tab, as shown below:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com


For all the example code, we have at the top of the sketch a few different ways you can communicate with the Bluefruit LE: hardware serial, software serial, hardware SPI and software SPI.

For the SPI Bluefruit, you cannot use serial. However, you can choose between hardware and software SPI.

If you want to use hardware SPI, uncomment this chunk of code (and comment out the other three options)

/* ...hardware SPI, using SCK/MOSI/MISO hardware SPI pins and then user selected CS/IRQ/RST */
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);

If you want to use software/bitbang SPI, uncomment the following definition. You can then use any 6 pins (or 5, if you dont want to use RST)

/* ...software SPI, using SCK/MOSI/MISO user-defined SPI pins and then user selected CS/IRQ/RST */
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_SCK, BLUEFRUIT_SPI_MISO,
                             BLUEFRUIT_SPI_MOSI, BLUEFRUIT_SPI_CS,
                             BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);

Basé sur "Bluefruit LE Shield" d'Adafruit Industries, écrit par Kevin Townsend - 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".

Based on "Bluefruit LE Shield" from Adafruit Industries, written by Kevin Townsend - 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).

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com