and now (continuing from another computer), here is the code we flashed to the bluefruit LE at the time:
// Sample UART relay using AdaFruit Feather 32u4 LE
#include <Arduino.h>
#include <SPI.h>
#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)
#include <SoftwareSerial.h>
#endif
#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"
#include "Adafruit_BluefruitLE_UART.h"
#define BUFSIZE 128 // Size of the read buffer for incoming data
#define VERBOSE_MODE true // If set to 'true' enables debug output
#define BLUEFRUIT_HWSERIAL_NAME Serial1
#define BLUEFRUIT_UART_MODE_PIN 12 // Set to -1 if unused
#define BLUEFRUIT_SPI_CS 8
#define BLUEFRUIT_SPI_IRQ 7
#define BLUEFRUIT_SPI_RST 4 // Optional but recommended, set to -1 if unused
#define FACTORYRESET_ENABLE 1
#define MINIMUM_FIRMWARE_VERSION "0.6.6"
#define MODE_LED_BEHAVIOUR "MODE"
// Create the bluefruit object
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
// A small helper
void error(const __FlashStringHelper*err) {
//Serial.println(err);
while (1);
}
/**************************************************************************/
void setup(void)
{
//while (!Serial); // required for Flora & Micro
//delay(500);
//Serial.begin(115200);
//Serial.println(F("JeVois Bluetooth Camera Interface"));
//Serial.println(F("------------------------------------------------"));
Serial1.begin(9600);
/* Initialise the module */
//Serial.print(F("Initialising the Bluefruit LE module: "));
if ( !ble.begin(VERBOSE_MODE) )
error(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() ) error(F("Couldn't factory reset"));
}
/* Disable command echo from Bluefruit */
ble.echo(false);
//Serial.println("Requesting Bluefruit info:");
/* Print Bluefruit information */
//ble.info();
//Serial.println(F("Please use Adafruit Bluefruit LE app to connect in UART mode"));
//Serial.println(F("Then Enter characters to send to the JeVois camera"));
//Serial.println();
ble.verbose(false); // debug info is a little annoying after this point!
/* Wait for connection */
while (! ble.isConnected()) {
delay(500);
}
//Serial.println(F("******************************"));
// LED Activity command is only supported from 0.6.6
if ( ble.isVersionAtLeast(MINIMUM_FIRMWARE_VERSION) )
{
// Change Mode LED Activity
//Serial.println(F("Change LED activity to " MODE_LED_BEHAVIOUR));
ble.sendCommandCheckOK("AT+HWModeLED=" MODE_LED_BEHAVIOUR);
}
// Set module to DATA mode
//Serial.println( F("Switching to DATA mode!") );
ble.setMode(BLUEFRUIT_MODE_DATA);
//Serial.println(F("********** READY *************"));
}
/**************************************************************************/
void loop(void)
{
while (ble.available()) Serial1.write(ble.read());
while (Serial1.available()) ble.write(Serial1.read());
}