I recently got an SPI ST7735S display (https://www.amazon.co.uk/dp/B07QJVG8QX?psc=1&ref=ppx_yo2ov_dt_b_product_details) along with a seeed xiao esp32c3 board to try and mess about with displaying stuff on a screen. Looking at the board, it seems to have the labels for the I2C protocol (SCL and SDA pins) instead of the SPI ones. I have also seen comments on amazon mentioning its definitely an SPI board not I2C but that they still got it working.
I've got a basic setup as follows (seeed board --> display):
GND --> GND
3V3 --> VCC
(also tried 5V --> VCC)
MOSI --> SDA
SCK --> SCL
D0 --> CS
D1 --> RES
D2 --> DC
Heres the pin diagram for the seeed board:
Pin diagram for the seeed XIAO board
Heres my code example currently. The expected behavior is to turn the screen blue when starting. I am using the Arduino IDE to program with extra libraries installed (Getting Started with Seeed Studio XIAO ESP32C3 | Seeed Studio Wiki)
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#define TFT_CS 0
#define TFT_RST 1
#define TFT_DC 2
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup() {
SPI.begin();
tft.initR(INITR_BLACKTAB);
tft.setRotation(1);
// Fill the screen with blue color
tft.fillScreen(ST77XX_BLUE);
}
void loop() {}
The code compiles and uploads with no errors. I have tried various example projects to no avail either. Am I missing something or are my pin connections wrong?