Default Pinout

In order to follow along with the default tutorial wiring, the Bluefruit LE SPI Friend should be connected to your Uno or Metro board using the following pins:

Bluefruit LE SPI Friend

SCK
MISO
MOSI
CS
IRQ
RST (Optional)

VIN
GND

Metro/Uno

13
12
11
8
7
4

5V
GND

We'll be using hardware serial by default, that uses the UNO's hardware pins #13, #12 and #11. You can also use software SPI so you don't have to locate the hardware SPI pins!

In order for the Bluefruit LE SPI Friend to be 5V-Safe, the VIN pin must be connected to 5V on the Arduino. If you wish to run the board with 3.3V logic, you can optionally connect VIN to 3.3V, but this should not be done on a 5V Arduino.

Changing the Default Pinout

The examples sketches all assume the above pinouts by default.  If you wish to change the location of the CS, IRQ or RST pins, open the BluefruitConfig.h file in the example folder, 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:

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);
Last updated on Jan 08, 2016 Published on Jul 07, 2015