title: Arduino Uno to Micro SPI pinout remapping?
body: <ul>
  <li>Web developer going into hardware so please, be gentle.</li>
  </ul>
  
  <p>Problem: I'm currently trying to use the BlueFruit LE breakout board and an Arduino Micro, however the pinouts are different as the Micro has dedicated SPI pins whereas the UNO has SCK, MISO and MOSI doing double duty on pins 13, 12 and 11.</p>
  
  <p>Question: Where in the Arduino IDE or the sample code I'm using can I change the requested pinouts?</p>
  
  <p>Code:</p>
  
  <p>echoDemo example sketch from Adafruit (truncated for brevity):</p>
  
  <pre><code> #include &lt;SPI.h&gt;
   #include "Adafruit_BLE_UART.h"
  
   // Connect CLK/MISO/MOSI to hardware SPI
   // e.g. On UNO &amp; compatible: CLK = 13, MISO = 12, MOSI = 11
   #define ADAFRUITBLE_REQ 10
   #define ADAFRUITBLE_RDY 2     // This should be an interrupt pin, on Uno thats #2 or #3
   #define ADAFRUITBLE_RST 9
  </code></pre>
  
  <p>As above states, the 'UNO &amp; compatible...' are looking for the correct pins on said board.</p>
  
  <p>I've done a search for the pins by name (CLK, etc) in the two #include files but haven't found their reference.</p>
  
  <p>The result should be the following output in the Arduino IDE Console:</p>
  
  <pre><code> Adafruit Bluefruit Low Energy nRF8001 Print echo demo
   * Advertising started
  </code></pre>
  
  <p>The second line should be returned from the BlueFruit LE board to the Micro and output to console.</p>
  
  <p>My result is only the first line is output.</p>
  
  <p>Understandably there are diagrams on the Arduino site where they detail the SPI pins and they're labelled clearly on the Micro (image attached). What I'm looking for is how/where to remap these pins to the Micro's pinout.</p>
  
  <p>Any help, references or files to dig into would be a massive help.</p>
  
  <p><img src="https://i.imgur.com/GZwTQIo.jpg" alt="Arduino Micro to BlueFruit LE Needs Remap"></p>
  
  <p>•• Update</p>
  
  <p>Thanks to the answers below, we're one step closer.</p>
  
  <p>The following changes were made to the pinout in the sketch:</p>
  
  <pre><code> #include &lt;SPI.h&gt;
   #include "Adafruit_BLE_UART.h"
  
   // Connect CLK/MISO/MOSI to hardware SPI
   // e.g. On UNO &amp; compatible: CLK = 13, MISO = 12, MOSI = 11
   #define ADAFRUITBLE_REQ SS
   #define ADAFRUITBLE_RDY 2     // This should be an interrupt pin, on Uno thats #2 or #3
   #define ADAFRUITBLE_RST 3
  </code></pre>
  
  <p>And the following is the modified ble_system.h:</p>
  
  <pre><code> #ifndef BLE_SYSTEM_H_
   #define BLE_SYSTEM_H
  
   /*
   #define HAL_IO_RADIO_CSN       SS
   #define HAL_IO_RADIO_REQN      SS
   #define HAL_IO_RADIO_RDY       3
   #define HAL_IO_RADIO_SCK       SCK
   #define HAL_IO_RADIO_MOSI      MOSI
   #define HAL_IO_RADIO_MISO      MISO
   #define HAL_IO_RADIO_RESET     9
   #define HAL_IO_RADIO_ACTIVE    8
  
   //#define HAL_IO_LED0          2
   //#define HAL_IO_LED1          6
   */
  </code></pre>
  
  <p>New Result:</p>
  
  <p>• Same output in the console for Line 1 "Adafruit Bluefruit Low Energy nRF8001 Print echo demo".</p>
  
  <p>• Typing "getState()" in console and hitting enter gives a massive parallel string of characters which crashes Arduino IDE</p>
  
  <p>This looks like the BTLE breakout board may actually be working properly, but the data incoming to the Micro isn't being parsed properly.</p>