   setDelegate(userFunctionHandler);
 
   pinMode(BLUEFRUIT_UART_MODE_PIN, OUTPUT);
-//  while (!Serial);  // required for Flora & Micro
-//  delay(500);
 
   Serial.begin(115200);
   Serial.println(F("Adafruit Bluefruit App Controller Example"));

    Serial.println(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
  }
  Serial.println( F("OK!") );

  if ( FACTORYRESET_ENABLE )
  {
    /* Perform a factory reset to make sure everything is in a known state */
    Serial.println(F("Performing a factory reset: "));
    if ( ! ble.factoryReset() ){
      Serial.println(F("Couldn't factory reset"));
    }
  }

  /* Disable command echo from Bluefruit */
  ble.echo(false);

#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_UART.h"

/*============================================================================
    APPLICATION SETTINGS
    VERBOSE_MODE              Set to 'true' enables debug output to

    - BLUETOOTH
    BLUEFRUIT_HWSERIAL_NAME   Name of the HW serial port the Bluefruit BLE
                              device is connected to
    BLUEFRUIT_UART_MODE_PIN   The pin that has been connected to 'MOD'           
    MINIMUM_FIRMWARE_VERSION  Minimum firmware version to have some features
    MODE_LED_BEHAVIOUR        LED activity, valid options are
                              "DISABLE" or "MODE" or "BLEUART" or
                              "HWUART"  or "SPI"  or "MANUAL"
============================================================================== */
#define VERBOSE_MODE                true
#define BLUEFRUIT_UART_MODE_PIN     5
#define BLUEFRUIT_HWSERIAL_NAME     Serial1
#define MINIMUM_FIRMWARE_VERSION    "0.6.6"
#define MODE_LED_BEHAVIOUR          "MODE"
/*=========================================================================*/

// Create the bluefruit object
Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
Bluetooth bluetooth(&ble, BLE_READPACKET_TIMEOUT);
void setup(void)
{
  // Serial port options for control of the Cube using serial commands are:
  // 0: Control via the USB connector (most common).
  // 1: Control via the RXD and TXD pins on the main board.
