Ligne 1 : |
Ligne 1 : |
| {{Bluefruit-LE-Shield-NAV}} | | {{Bluefruit-LE-Shield-NAV}} |
− |
| |
− | {{traduction}}
| |
| | | |
| == Raccordement par défaut == | | == Raccordement par défaut == |
Ligne 43 : |
Ligne 41 : |
| Si vous voulez que les croquis/sketch d'exemple utilisent des broches SPI différentes (pour CS, IRQ ou RST) alors ouvrez le fichier '''BluefruitConfig.h''' disponible dans le répertoire exemple (de l'exemple que vous désirez tester). | | Si vous voulez que les croquis/sketch d'exemple utilisent des broches SPI différentes (pour CS, IRQ ou RST) alors ouvrez le fichier '''BluefruitConfig.h''' disponible dans le répertoire exemple (de l'exemple que vous désirez tester). |
| | | |
− | Dans ce fichier .h, il faudra changer les broches pour qu'elles aient la nouvelle affectation souhaitée (Voyez la section "[[Bluefruit-LE-Shield-Install|Logiciel]]" pour savoir comment installer la bibliothèque): | + | Dans ce fichier .h, il faudra changer les broches pour qu'elles aient la nouvelle affectation souhaitée (Voyez la section "[[Bluefruit-LE-Shield-Install|Logiciel]]" pour savoir comment installer la bibliothèque). |
| + | |
| + | Si vous voulez utiliser '''le SPI Logiciel (bitbang)''', vous pouvez utiliser les valeurs de broche suivantes pour SCK, MISO et MOSI: |
| | | |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| + | // SPI Logiciel |
| #define BLUEFRUIT_SPI_CS 8 | | #define BLUEFRUIT_SPI_CS 8 |
| #define BLUEFRUIT_SPI_IRQ 7 | | #define BLUEFRUIT_SPI_IRQ 7 |
Ligne 51 : |
Ligne 52 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | 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:
| + | Pour revenir à la configuration SPI Matériel (sur un Arduino UNO), vous pouvez utiliser les valeurs de broches suivantes pour SCK, MISO et MOSI: |
| | | |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| + | // SPI Materiel |
| #define BLUEFRUIT_SPI_SCK 13 | | #define BLUEFRUIT_SPI_SCK 13 |
| #define BLUEFRUIT_SPI_MISO 12 | | #define BLUEFRUIT_SPI_MISO 12 |
Ligne 59 : |
Ligne 61 : |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | The '''BluefruitConfig.h''' file can be found in a dedicated tab, as shown below:
| + | Le fichier '''BluefruitConfig.h''' peut être trouvé dans le volet dédicacé (voir ci-dessous): |
| | | |
| {{ADFImage|Bluefruit-LE-Shield-Brancher-00.png}} | | {{ADFImage|Bluefruit-LE-Shield-Brancher-00.png}} |
| | | |
− | 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.
| + | Dans tous les codes d'exemple, Adafruit a ajouter une section en début de croquis/sketch reprenant les différentes manières de communiquer avec Bluefruit LE: port série matériel, port série logiciel, bus SPI matériel, bus SPI logiciel. |
| | | |
− | For the SPI Bluefruit, you cannot use serial. However, you can choose between hardware and software SPI.
| + | Il n'est pas possible d'utiliser la communication série sur un Bluefruit SPI. Il est cependant possible de choisir entre le bus SPI matériel ou SPI logiciel (bitbang). |
| | | |
− | If you want to use hardware SPI, uncomment this chunk of code (and comment out the other three options)
| + | Si vous désirez utiliser le bus SPI matériel, retirez le commentaire sur le bout de code suivant (et commentez les trois autres sections) |
| | | |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| + | /* Traduction MCHobby: ...SPI Matériel utilisant les broches du SPI matériel SCK/MOSI/MISO (par défaut) et les broches CS/IRQ/RST définies par l'utilisateur */ |
| + | |
| /* ...hardware SPI, using SCK/MOSI/MISO hardware SPI pins and then user selected CS/IRQ/RST */ | | /* ...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); | | Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST); |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | 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)
| + | Si vous désirez utiliser du SPI logiciel (bitbang), retirez le commentaire sur le bout de code suivant. Vous pouvez utiliser 6 broches au choix (ou 5 si vous ne voulez pas utiliser RST) |
| | | |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| + | /* Traduction MCHobby: ...SPI logiciel utilisant les broches SPI SCK/MOSI/MISO définies par l'utilisateur et les broches CS/IRQ/RST définies par l'utilisateur */ |
| + | |
| /* ...software SPI, using SCK/MOSI/MISO user-defined SPI pins and then user selected CS/IRQ/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, | | Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_SCK, BLUEFRUIT_SPI_MISO, |