Adafruit Feather M0 Bluefruit LE Support

Hi Blynkers,

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial

#define BLYNK_USE_DIRECT_CONNECT

#include <BlynkSimpleSerialBLE.h>
#include <SPI.h>
#include <Adafruit_BLE.h>
#include <Adafruit_BluefruitLE_SPI.h>

// Blynkアプリのナットアイコンをクリックして、
// AUTH TOKENを貼り付けてください
char auth[] = "xxxx";

// SHARED SPI SETTINGS (see adafruit webpages for details)
#define BLUEFRUIT_SPI_CS               8
#define BLUEFRUIT_SPI_IRQ              7
#define BLUEFRUIT_SPI_RST              4    // Optional but recommended, set to -1 if unused
#define BLUEFRUIT_VERBOSE_MODE         true

// Create ble instance, see pinouts above
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);

// LEDウィジェット制御用
WidgetLED led1(V3);
WidgetLED led2(V4);

void setup() {
  // シリアルポート初期化
  Serial.begin(9600);

  // BLEライブラリ初期化
  ble.begin(BLUEFRUIT_VERBOSE_MODE);
  ble.factoryReset(); // Optional
  ble.setMode(BLUEFRUIT_MODE_DATA);

  // Blynkライブラリ初期化
  Blynk.begin(auth, ble);
}

// 仮想ピンV1の書き込み
BLYNK_WRITE(V1)
{
  // 仮想ピンV1を通してジョイスティックの値を読み取る
  int x = param[0].asInt();
  int y = param[1].asInt();
  int speed;

  // yがプラスなら前進
  if (y >= 0) {
    led1.on();
    led2.off();
    speed = sqrt(x * x + y * y);  // ベクトルを計算
    analogWrite(11, 0);
    analogWrite(12, map(speed, 0, 127, 0, 255));  // 0-127の値を0-255にマッピングして書き込む
  }
  // yがマイナスなら後退
  else {
    led1.off();
    led2.on();
    speed = sqrt(x * x + y * y);
    analogWrite(11, map(speed, 0, 127, 0, 255));
    analogWrite(12, 0);
  }

  // 仮想ピンV2にスピードを書き込む
  Blynk.virtualWrite(2, speed);
}

void loop() {
  Blynk.run();
}
  1. Only Android App detected the BLE, not iOS.
  2. The Feather M0 received data from Blynk but Blynk app was not receiving any data from Feather.

So, in brief,

  • Is iOS is going to be supported (master-peripheral mode).
  • Can Android app receive data from BLE devices (nRF51822 chip) which Feather is built on top of it?

I’ll receive the kit in few days and hope to get more insights if someone successfully tried it out on both platforms with send/receive data.

Thanks

Hi @wbadry,

have you been successful? I am asking because I am planning to by an Adafruit Feather M0 with BLuetooth too :slight_smile:

@wbadry sorry for a late reply, we have no feather boards at our side to test this issue. so if you could run one of our log builds to check what’s going on in ble communication with feather board it will help us to fix this issue.