[SOLVED] Getting the ST7735 to work with Spark

Hmm, that’s odd if only the defines make the difference.

It should and did work, but one contributing factor could be that A2, D0 and D7 are #defines themselves and so the preprocessor would need to resolve multiple “layers” - maybe there was some change in the buildfarm that causes this behaviour now (ping @Dave)

Meanwhile could you try this, if this proves me right or wrong

#define relay 07
#define cs    12
#define dc    06
#define rst    0

This removes the need for double resolve (just for testing, since it’s not considered good style, so don’t use in production code ;-))

To avoid wasting precious RAM use const int relay = D7;


On the other hand, when I try this code things work as expected

#define relay D7
#define cs A2
#define dc D6
#define rst 0

char msg[255];
float x = 3.1415;

void setup()
{
    Serial.begin(115200);
    
}

void loop()
{
    sprintf(msg, "%2d\t%2d\t%2d", relay, cs, dc);
    Serial.println(msg);
    delay(1000);
}

On Web IDE (Particle Build) - are you using this too?

A possible other reason could be found in these threads
[Solved] PinMode in Object Constructors/Functions?
Why does this code compile properly, but make my Core flash red?