Wiring

Default Pinout

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:

Bluefruit LE SPI Pins

SCK
MISO
MOSI
CS
IRQ
RST

Arduino Pins

Hardware SPI SCK
Hardware SPI MISO
hardware SPI MOSI
8
7
4

We'll be using hardware SPI by default. 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.

Changing the Default Pinout

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):

Download: file
#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:

Download: 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:

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)

Download: file
/* ...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)

Download: file
/* ...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);
This guide was first published on Oct 09, 2015. It was last updated on Oct 09, 2015. This page (Wiring) was last updated on Oct 09, 2015.