I bought the nRF8001 module and got it working perfectly on my Arduino UNO.
I also bought a 1.8 TFT (not Adafruit!, but the cheaper red pcd one) display and got this working with the ST7735 library. No problems.
Now my plan was to bring it all together and sending data to show on the TFT coming from bluetooth. But I face a problem.
When I run the code tft.initR(INITR_BLACKTAB); the bluetooth module is no longer detectable.
Here is my code:
Code: Select all
#include <SPI.h>
#include "Adafruit_BLE_UART.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#define ADAFRUITBLE_REQ 10
#define ADAFRUITBLE_RDY 2
#define ADAFRUITBLE_RST 0
Adafruit_BLE_UART uart = Adafruit_BLE_UART(ADAFRUITBLE_REQ, ADAFRUITBLE_RDY, ADAFRUITBLE_RST);
#define TFT_CS 4
#define TFT_RST 0
#define TFT_DC 8
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup(void) {
Serial.begin(9600);
while(!Serial); // Leonardo/Micro should wait for serial init
Serial.println(F("Adafruit Bluefruit Low Energy nRF8001 Callback Echo demo"));
uart.setRXcallback(rxCallback);
uart.setACIcallback(aciCallback);
uart.begin();
tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
tft.setRotation(3);
tft.fillScreen(ST7735_BLACK);
}
Many thanks!