Indeed - playing up - means was working and is now not working at least partially.
This is the wiring for adafruit ST7735 module. I am using a Core and I am powering from the 5V Vin - powered by USB connected to a iMac.

My 1.8tftwithsdtest.ino is here - I started on this journey just trying to be able to load images on the TFT.
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_ST7735/Adafruit_ST7735.h"
// This #include statement was automatically added by the Particle IDE.
#include "sd-card-library/sd-card-library.h"
/**
* 1.8 inch TFT SPI Screen ST7735 adafruit
* Board Core
* LITE A0
* TFTCS D5 TFT Chip/Slave Select
* SDCS D4 SD Chip/Slave Select
* Vcc 5V
* GND GND
* SCK A3 Clock
* D/C A2 command
* MOSI A5 Data MOSI
* MISO A4 Data MISO
* RESET not connected
**/
#include "Adafruit_ST7735/Adafruit_mfGFX.h"
#include "Adafruit_ST7735/fonts.h"
#include "application.h"
#define BUFFPIXEL 20
const uint8_t chipSelect = D4;
const uint8_t mosiPin = A5;
const uint8_t misoPin = A4;
const uint8_t clockPin = A3;
unsigned long startMilli = 0UL;
SdFile root;
Sd2Card card;
SdVolume volume;
Adafruit_ST7735 tft = Adafruit_ST7735(D5, A2, 0); // hardware spi
void setup()
{
Serial.begin(9600);
Serial.println("Wait for 5 seconds");
startMilli = millis();
while ((millis()-startMilli) < 5000); //wait for 5 seconds
Serial.println("Done Waiting");
//
pinMode(A0, OUTPUT); //PWM on A0 for backlight
analogWrite(A0, 0); //backlight off
//
Serial.print("Initializing SD card...");
// Initialize SOFTWARE SPI - note Hardware does not work
if (!card.init(mosiPin, misoPin, clockPin, chipSelect))
{
Serial.println("initialization failed! 1");
return;
}
if (!SD.begin(mosiPin, misoPin, clockPin, chipSelect))
{
Serial.println("initialization failed! 2");
return;
}
Serial.println("initialization done.");
if (!volume.init(card))
{
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
return;
}
//
tft.initR(INITR_BLACKTAB); //for the ST7735R
Serial.println("Wait for 5 seconds");
startMilli = millis();
while ((millis()-startMilli) < 2000); //wait for 2 seconds
Serial.println("Done Waiting");
tft.fillScreen(ST7735_WHITE);
tft.setRotation(0); //portrait
analogWrite(A0,127); // backlight on
tft.setFont(2); //arial
tft.setTextSize(1);
tft.setTextColor(ST7735_BLACK);
tft.setCursor(0,0);
tft.println("TFT init done");
Serial.println("TFT initialisation done");
bmpDraw("parrot.bmp", 0, 0);
}
void loop(void)
{
}
// This function opens a Windows Bitmap (BMP) file and
// displays it at the given coordinates. It's sped up
// by reading many pixels worth of data at a time
// (rather than pixel by pixel). Increasing the buffer
// size takes more of the Particle's precious RAM but
// makes loading a little faster. 20 pixels seems a
// good balance.
// Pass 8-bit (each) R,G,B, get back 16-bit packed color
void bmpDraw(char *filename, uint8_t x, uint16_t y)
{
File bmpFile;
int bmpWidth, bmpHeight; // W+H in pixels
uint8_t bmpDepth; // Bit depth (currently must be 24)
uint16_t bmpType;
uint32_t bmpImageoffset; // Start of image data in file
uint32_t rowSize; // Not always = bmpWidth; may have padding
uint8_t sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
uint8_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
boolean goodBmp = false; // Set to true on valid header parse
boolean flip = true; // BMP is stored bottom-to-top
int w, h, row, col;
uint8_t r, g, b;
uint32_t pos = 0;
if ((x >= tft.width()) || (y >= tft.height())) return;
//truncated
}
I can read the test parrot.BMP fine with just SD card reading using software SPI.
I am now getting the adafruit display to work (hence playing up) but I get this message:
Initializing SD card…Error: CMD0
Error: Sd2Card::init()
initialization failed! 1
from the SD card with software SPI. I am thinking that the card.init using the software SPI is troubling the tft.init if this is done before, so it seems that one can have an SD card reader or a TFT display but not both at the same time?