Hello,
I’ve been trying to use a bluetooth device (Adafruit BLE SPI Friend) with the Balboa 32u4 with no success. To begin, I loaded the Balancer demo program to get an idea of how quickly the yellow and green lights track the tipping motion. They’re pretty responsive! Only a few milliseconds response time, I’d guess.
Next I loaded the Controller demo program from Adafruit’s library to test the SPI communication with the board. Both of these gave me favorable results with my iPhone and the bluefruit app:
/* ...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);
and
/* ...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);
Next, I started combining the code, recompiling along the way, until I had a working program. The issue is that when the SPI code is loaded, the yellow and green lights update every second or so. Much slower than the Balance code alone.
I noticed that the SCK and MOSI pins are also shared with the Right Motor Direction and Left Motor Direction.
I’m using the following pins for my interface:
#define BLUEFRUIT_SPI_SCK 15
#define BLUEFRUIT_SPI_MISO 14
#define BLUEFRUIT_SPI_MOSI 16
I also use these pins:
#define BLUEFRUIT_SPI_CS 1
#define BLUEFRUIT_SPI_IRQ 0
Can you suggest anything to help speed up the update rate while taking commands from the BLE?